Examples of UiProvider


Examples of com.vaadin.server.UIProvider

        List<UIProvider> uiProviders = session.getUIProviders();

        UIClassSelectionEvent classSelectionEvent = new UIClassSelectionEvent(
                request);

        UIProvider provider = null;
        Class<? extends UI> uiClass = null;
        for (UIProvider p : uiProviders) {
            // Check for existing LegacyWindow
            if (p instanceof LegacyApplicationUIProvider) {
                LegacyApplicationUIProvider legacyProvider = (LegacyApplicationUIProvider) p;

                UI existingUi = legacyProvider
                        .getExistingUI(classSelectionEvent);
                if (existingUi != null) {
                    reinitUI(existingUi, request);
                    return existingUi;
                }
            }

            uiClass = p.getUIClass(classSelectionEvent);
            if (uiClass != null) {
                provider = p;
                break;
            }
        }

        if (provider == null || uiClass == null) {
            return null;
        }

        // Check for an existing UI based on embed id

        String embedId = getEmbedId(request);

        UI retainedUI = session.getUIByEmbedId(embedId);
        if (retainedUI != null) {
            if (vaadinService.preserveUIOnRefresh(provider, new UICreateEvent(
                    request, uiClass))) {
                if (uiClass.isInstance(retainedUI)) {
                    reinitUI(retainedUI, request);
                    return retainedUI;
                } else {
                    getLogger().info(
                            "Not using the preserved UI " + embedId
                                    + " because it is of type "
                                    + retainedUI.getClass() + " but " + uiClass
                                    + " is expected for the request.");
                }
            }
            /*
             * Previous UI without preserve on refresh will be closed when the
             * new UI gets added to the session.
             */
        }

        // No existing UI found - go on by creating and initializing one

        Integer uiId = Integer.valueOf(session.getNextUIid());

        // Explicit Class.cast to detect if the UIProvider does something
        // unexpected
        UICreateEvent event = new UICreateEvent(request, uiClass, uiId);
        UI ui = uiClass.cast(provider.createInstance(event));

        // Initialize some fields for a newly created UI
        if (ui.getSession() != session) {
            // Session already set for LegacyWindow
            ui.setSession(session);
        }

        PushMode pushMode = provider.getPushMode(event);
        if (pushMode == null) {
            pushMode = session.getService().getDeploymentConfiguration()
                    .getPushMode();
        }
        ui.getPushConfiguration().setPushMode(pushMode);

        Transport transport = provider.getPushTransport(event);
        if (transport != null) {
            ui.getPushConfiguration().setTransport(transport);
        }

        // Set thread local here so it is available in init
View Full Code Here

Examples of com.vaadin.server.UIProvider

        private final List<UIProvider> uiProviders;

        private DevVaadinServiceSession(VaadinService service) {
            super(service);
            final UIProvider provider = new DevUIProvider(ui, theme);
            this.uiProviders = Collections.singletonList(provider);
        }
View Full Code Here

Examples of org.jboss.forge.addon.ui.UIProvider

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIProvider provider = context.getUIContext().getProvider();
      UIOutput output = provider.getOutput();
      UIPrompt prompt = context.getPrompt();
      boolean answer = prompt.promptBoolean("Do you love Forge 2?");
      output.out().println("You answered: " + answer);
      return null;
   }
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        return checkBox.isSelected() ? password : null;
    }

    @Override
    public void decorate(UiCanvas canvas) {
        UiProvider ui = createUi();
        ui.decorate(canvas);
    }
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        private UiProvider createLayout(Operation from, IntegrationEntity to) {
            JLabel caption = WizardStyleSheet.SMALL_SECTION_STYLE.makeLabel(
                            Strings.get("RouteTypeSelector.SelectType"));
            caption.setBorder(Empty.border(0, 0, 5, 0));
            UiProvider buttonUi = buttons.getUi(caption, RadioButtonGroupPanel.Layout.TWO_ROWS);
            BoxBuilder col = BoxBuilder.vertical().leftAligned();
            col.addAllWithSpace(32, createCaption(from, to), buttonUi);
            return col;
        }
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        cols.setFill(OneColumnPanel.BOTH);
        cols.setWeightX(1.0);
        cols.setWeightY(1.0 / tables.size());
        cols.setInsets(2, 0, 10, 0);
        for (WhereClauseTable t : tables) {
            UiProvider tableUi = t.getUi();
            DropDownPanel ddp = new DropDownPanel(BorderLayoutBuilder.fillWith(tableUi), t.getDbObject().getName(), true);
            ddp.setOpaque(false);
            cols.add(ddp.getDisplayer());
        }
        cols.setOpaque(false, false);
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        }
    }
   
    @Override
    public void decorate(UiCanvas canvas) {
        UiProvider ui = selector.getUi(null, RadioButtonGroupPanel.Layout.ONE_ROW);
        JComponent wrapper = InvisiblePanel.newPanel(ui);
        wrapper.setBorder(StyleSheet.getLineTitleBorder(PackageResources.SearchParamsDefiner.SCOPE_TITLE));
        canvas.display(wrapper);
    }
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        this.title = title;
    }

    public UiProvider getUi() {
        final JComponent ui = createUi();
        return new UiProvider() {

            @Override
            public void decorate(UiCanvas canvas) {
                canvas.display(ui);
            }
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        };
        UiUtils.runOnEventThread(job);
    }

    private JComponent layoutComponents() {
        UiProvider ui;
        if (ToolbarMode.getConfiguredMode() == ToolbarMode.MINIMAL) {
            TwoColumnPanel grid = new TwoColumnPanel();
            grid.setInsets(2, 2, 2, 2);
            grid.addRow(serverCaption, serverLabel).addRow(userCaption, userLabel);
            grid.setOpaque(false, false);
View Full Code Here

Examples of org.jitterbit.ui.UiProvider

        layout.north(layoutTop()).center(browser);
        layout.decorate(canvas);
    }

    private UiProvider layoutTop() {
        UiProvider titlePanel = createTitlePanel();
        if (isTabBased()) {
            return titlePanel;
        } else {
            OneColumnPanel col = new OneColumnPanel();
            col.setWeightX(1.0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.