Example usage for com.vaadin.ui Window setSizeFull

List of usage examples for com.vaadin.ui Window setSizeFull

Introduction

In this page you can find the example usage for com.vaadin.ui Window setSizeFull.

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:net.sourceforge.javydreamercsw.validation.manager.web.template.TemplateScreenProvider.java

License:Apache License

private void displayTemplateCopyWizard() {
    Wizard w = new Wizard();
    Window cw = new VMWindow();
    TemplateComponent tc = new TemplateComponent(new Template(), true);
    w.addStep(new WizardStep() {

        @Override/*from   w  w  w.j  ava  2  s .  co m*/
        public String getCaption() {
            return TRANSLATOR.translate("template.copy");
        }

        @Override
        public Component getContent() {
            return tc;
        }

        @Override
        public boolean onAdvance() {
            try {
                TemplateServer t = new TemplateServer(tc.getTemplate());
                t.write2DB();
                return t.getId() > 0;
            } catch (Exception ex) {
                LOG.log(Level.SEVERE, null, ex);
                Notification.show(TRANSLATOR.translate("general.error.record.creation"),
                        ex.getLocalizedMessage(), Notification.Type.ERROR_MESSAGE);
            }
            return false;
        }

        @Override
        public boolean onBack() {
            return false;
        }
    });
    w.addListener(new WizardProgressListener() {
        @Override
        public void activeStepChanged(WizardStepActivationEvent event) {
            //Do nothing
        }

        @Override
        public void stepSetChanged(WizardStepSetChangedEvent event) {
            //Do nothing
        }

        @Override
        public void wizardCompleted(WizardCompletedEvent event) {
            ((VMUI) UI.getCurrent()).updateScreen();
            ((VMUI) UI.getCurrent()).showTab(getComponentCaption());
            UI.getCurrent().removeWindow(cw);
        }

        @Override
        public void wizardCancelled(WizardCancelledEvent event) {
            UI.getCurrent().removeWindow(cw);
        }
    });
    cw.setContent(w);
    cw.setSizeFull();
    UI.getCurrent().addWindow(cw);
}

From source file:net.sourceforge.javydreamercsw.validation.manager.web.template.TemplateScreenProvider.java

License:Apache License

private void displayTemplateCreateWizard() {
    Wizard w = new Wizard();
    Window cw = new VMWindow();
    TemplateComponent tc = new TemplateComponent(new Template(), true);
    w.addStep(new WizardStep() {
        private final TextField nameField = new TextField(TRANSLATOR.translate("general.name"));

        @Override/*from  ww  w.  ja  v a2 s . co m*/
        public String getCaption() {
            return TRANSLATOR.translate("add.template");
        }

        @Override
        public Component getContent() {
            return tc;
        }

        @Override
        public boolean onAdvance() {
            try {
                TemplateServer t = new TemplateServer(tc.getTemplate());
                t.write2DB();
                return t.getId() > 0;
            } catch (Exception ex) {
                LOG.log(Level.SEVERE, null, ex);
                Notification.show(TRANSLATOR.translate("general.error.record.creation"),
                        ex.getLocalizedMessage(), Notification.Type.ERROR_MESSAGE);
            }
            return false;
        }

        @Override
        public boolean onBack() {
            return false;
        }
    });
    w.addListener(new WizardProgressListener() {
        @Override
        public void activeStepChanged(WizardStepActivationEvent event) {
            //Do nothing
        }

        @Override
        public void stepSetChanged(WizardStepSetChangedEvent event) {
            //Do nothing
        }

        @Override
        public void wizardCompleted(WizardCompletedEvent event) {
            ((VMUI) UI.getCurrent()).updateScreen();
            ((VMUI) UI.getCurrent()).showTab(getComponentCaption());
            UI.getCurrent().removeWindow(cw);
        }

        @Override
        public void wizardCancelled(WizardCancelledEvent event) {
            UI.getCurrent().removeWindow(cw);
        }
    });
    cw.setContent(w);
    cw.setSizeFull();
    UI.getCurrent().addWindow(cw);
}

From source file:net.sourceforge.javydreamercsw.validation.manager.web.ValidationManagerUI.java

License:Apache License

private void addTestCaseAssignment(ContextMenu menu) {
    MenuItem create = menu.addItem(TRANSLATOR.translate("assign.test.case.execution"), ASSIGN_ICON,
            (MenuItem selectedItem) -> {
                Wizard w = new Wizard();
                Window sw = new VMWindow();
                w.addStep(new AssignUserStep(ValidationManagerUI.this, tree.getValue()));
                w.addListener(new WizardProgressListener() {
                    @Override/*w  w w .j ava2s  .c  o  m*/
                    public void activeStepChanged(WizardStepActivationEvent event) {
                        //Do nothing
                    }

                    @Override
                    public void stepSetChanged(WizardStepSetChangedEvent event) {
                        //Do nothing
                    }

                    @Override
                    public void wizardCompleted(WizardCompletedEvent event) {
                        removeWindow(sw);
                    }

                    @Override
                    public void wizardCancelled(WizardCancelledEvent event) {
                        removeWindow(sw);
                    }
                });
                sw.setContent(w);
                sw.setSizeFull();
                addWindow(sw);
            });
    create.setEnabled(checkRight("testplan.planning"));
}

From source file:org.aksw.autosparql.tbsl.gui.vaadin.TBSLApplication.java

License:Apache License

@Override
public void init() {
    // Create the application data instance
    UserSession sessionData = new UserSession(this);
    // Register it as a listener in the application context
    getContext().addTransactionListener(sessionData);

    setTheme("custom");

    ViewHandler.initialize(this);
    SessionHandler.initialize(this);
    Permissions.initialize(this, new JPAPermissionManager());

    Window mainWindow = new Window("AutoSPARQL TBSL");
    mainWindow.addParameterHandler(this);
    setMainWindow(mainWindow);//from ww w  . j  a  v a2s  .  c  o m

    mainView = new MainView();
    mainWindow.setContent(mainView);
    mainWindow.setSizeFull();

    setLogoutURL("http://aksw.org");

    mainWindow.addActionHandler(new Action.Handler() {

        @Override
        public void handleAction(Action action, Object sender, Object target) {
            if (action == action_query) {
                onShowLearnedQuery();
            }

        }

        @Override
        public Action[] getActions(Object target, Object sender) {
            return new Action[] { action_query };
        }
    });

}

From source file:org.eclipse.hawkbit.ui.distributions.smtable.SwModuleDetails.java

License:Open Source License

private void showArtifactDetailsWindow(final SoftwareModule softwareModule) {
    final Window artifactDtlsWindow = new Window();
    artifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(
            softwareModule.getName() + "." + softwareModule.getVersion(), getI18n()));
    artifactDtlsWindow.setCaptionAsHtml(true);
    artifactDtlsWindow.setClosable(true);
    artifactDtlsWindow.setResizable(true);
    artifactDtlsWindow.setImmediate(true);
    artifactDtlsWindow.setWindowMode(WindowMode.NORMAL);
    artifactDtlsWindow.setModal(true);//from w  w  w  .  j a v  a2  s. c om
    artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);

    artifactDetailsLayout.setFullWindowMode(false);
    artifactDetailsLayout.populateArtifactDetails(softwareModule);
    artifactDetailsLayout.getArtifactDetailsTable().setWidth(700, Unit.PIXELS);
    artifactDetailsLayout.getArtifactDetailsTable().setHeight(500, Unit.PIXELS);
    artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());

    artifactDtlsWindow.addWindowModeChangeListener(event -> {
        if (event.getWindowMode() == WindowMode.MAXIMIZED) {
            artifactDtlsWindow.setSizeFull();
            artifactDetailsLayout.setFullWindowMode(true);
            artifactDetailsLayout.createMaxArtifactDetailsTable();
            artifactDetailsLayout.getMaxArtifactDetailsTable().setWidth(100, Unit.PERCENTAGE);
            artifactDetailsLayout.getMaxArtifactDetailsTable().setHeight(100, Unit.PERCENTAGE);
            artifactDtlsWindow.setContent(artifactDetailsLayout.getMaxArtifactDetailsTable());
        } else {
            artifactDtlsWindow.setSizeUndefined();
            artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
        }
    });
    UI.getCurrent().addWindow(artifactDtlsWindow);
}

From source file:org.esn.esobase.view.MainView.java

private void openSearchInCatalogs() {
    if (searchInCatalogsTabContent == null) {
        searchInCatalogsTabContent = new SearchInCatalogsTab(service, dictionaryService);
    }//from  ww  w.j a  v  a2 s.  co m
    Window subWindow = new Window(searchInCatalogsMenuItem.getText());
    subWindow.setModal(true);

    subWindow.center();
    this.getUI().addWindow(subWindow);
    subWindow.setResizable(false);
    subWindow.setSizeFull();
    subWindow.setContent(searchInCatalogsTabContent);
    searchInCatalogsTabContent.setWidth();
}

From source file:org.esn.esobase.view.MainView.java

private void openSearchInRaw() {
    if (searchInRawStringsTabContent == null) {
        searchInRawStringsTabContent = new SearchInRawStringsTab(service);
    }/*from w  w w.jav  a  2  s .co  m*/
    Window subWindow = new Window(searchInRawStringsMenuItem.getText());
    subWindow.setModal(true);

    subWindow.center();
    this.getUI().addWindow(subWindow);
    subWindow.setResizable(false);
    subWindow.setSizeFull();
    subWindow.setContent(searchInRawStringsTabContent);
    searchInRawStringsTabContent.setWidth();
}

From source file:org.opennms.features.jmxconfiggenerator.webui.JmxConfigGeneratorApplication.java

License:Open Source License

/**
 * Creates the main window and adds the header, main and button panels to
 * it.//from  w ww  .  j  a  va2  s.  com
 */
private void initMainWindow() {
    Window window = new Window("JmxConfigGenerator GUI Tool");
    VerticalLayout layout = new VerticalLayout();
    layout.addComponent(headerPanel);
    layout.addComponent(contentPanel);
    // content Panel should use most of the space :)
    layout.setExpandRatio(contentPanel, 1);
    window.setContent(layout);
    window.getContent().setSizeFull();
    window.setSizeFull();
    addWindow(window);
}

From source file:org.semanticsoft.vaaclipse.app.VaadinApplication.java

License:Open Source License

@Override
public void init() {
    context = VaadinE4Application.getInstance().getAppContext();
    logger = VaadinE4Application.getInstance().getLogger();

    //--user agent detection
    //      if (this.getContext() instanceof WebApplicationContext) {
    //         String userAgent = ((WebApplicationContext)this.getContext()).getBrowser().getBrowserApplication();
    //         if (userAgent.contains("MSIE"))
    //         {/*ww w.  ja va  2 s. c o m*/
    //            String str = "<html><br/>Vaaclipse currently does not support Internet Explorer.<br/><br/>" +
    //                  "Please use one of the browser from list:<br/><ul><li>Mozilla Firefox (recomended)</li> <li>Google Chrome or Chromium</li> <li>Opera</li> <li>Safari</li> <li>Rekonq</li> <li>Any other not listed browser based on Webkit</li></ul></html>";
    //            Label errorLabel = new Label(str, Label.CONTENT_XHTML);
    //            mainWindow.getContent().addComponent(errorLabel);
    //            return;
    //         }
    //      }
    //--

    //-------------------------------------
    prepareEnvironment(context);

    IEventBroker eventBroker = appContext.get(EventBroker.class);

    eventBroker.subscribe(ThemeConstants.Events.setThemeEvent, new EventHandler() {

        @Override
        public void handleEvent(Event event) {
            Theme theme = (Theme) event.getProperty(IEventBroker.DATA);
            if (theme != null) {
                HttpSession session = ((WebApplicationContext) getContext()).getHttpSession();
                session.setAttribute(ThemeConstants.Attrubutes.themeid, theme.getId());
                setThemeInternal(theme.getWebId());
            }
        }
    });

    String themeId = VaadinE4Application.getInstance().getCssTheme();
    ThemeManager themeManager = appContext.get(ThemeManager.class);
    themeManager.setTheme(themeId);

    String authProvider = VaadinE4Application.getInstance().getApplicationAuthenticationProvider();

    if (authProvider == null || authProvider.trim().isEmpty()) {
        //start workbench as usually
        e4Workbench = createE4Workbench(context);
        e4Workbench.createAndRunUI(e4Workbench.getApplication());
    } else {
        final Window window = new Window("Login");
        window.setSizeFull();
        setMainWindow(window);

        eventBroker.subscribe(AuthenticationConstants.Events.Authentication, new EventHandler() {

            @Override
            public void handleEvent(Event event) {
                Object data = event.getProperty(EventUtils.DATA);
                if (data instanceof User) {
                    //login user:
                    user = (User) data;

                    //TODO: Now we can load persistande model of this user (not implemented yet, just load initial model)
                    e4Workbench = createE4Workbench(context);
                    e4Workbench.createAndRunUI(e4Workbench.getApplication());
                }
            }
        });

        IContributionFactory contributionFactory = (IContributionFactory) appContext
                .get(IContributionFactory.class.getName());
        IEclipseContext authConext = appContext.createChild();
        VerticalLayout windowContent = new VerticalLayout();
        windowContent.setSizeFull();
        window.setContent(windowContent);
        authConext.set(ComponentContainer.class, windowContent);
        authConext.set(VerticalLayout.class, windowContent);
        Object authProviderObj = contributionFactory.create(authProvider, authConext);
        System.out.println(authProvider);
    }
}

From source file:org.vaadin.arborgraph.demo.DemoApplication.java

License:Open Source License

@SuppressWarnings("serial")
@Override//from w  w  w .j  a v a 2 s  .  c o m
public void init() {
    VerticalLayout aboutLayout = new VerticalLayout();
    aboutLayout.setSizeFull();
    aboutLayout.addComponent(new Label(getBlah(), Label.CONTENT_XHTML));

    final ArborGraph graph = new ArborGraph();
    graph.setSizeFull();

    Button exampleGraphButton = new Button("Show Example", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(getDemoBranch());
        }
    });

    Label orLabel = new Label("<i>or</i>", Label.CONTENT_XHTML);
    orLabel.setSizeUndefined();

    final TextField jsonTextfield = new TextField();
    jsonTextfield.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    jsonTextfield.setNullRepresentation("");

    Button jsonBranchButton = new Button("Display Json Branch", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(jsonTextfield.getValue().toString());
        }
    });

    Label helpLabel = getHelpLabel(getBranchExplanation());

    HorizontalLayout graphButtonLayout = new HorizontalLayout();
    graphButtonLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    graphButtonLayout.setSpacing(true);
    graphButtonLayout.setMargin(false, false, true, false);
    graphButtonLayout.addComponent(exampleGraphButton);
    graphButtonLayout.addComponent(orLabel);
    graphButtonLayout.setComponentAlignment(orLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonBranchButton);
    graphButtonLayout.addComponent(helpLabel);
    graphButtonLayout.setComponentAlignment(helpLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonTextfield);
    graphButtonLayout.setExpandRatio(jsonTextfield, .9f);

    VerticalLayout graphLayout = new VerticalLayout();
    graphLayout.setSizeFull();
    graphLayout.setMargin(true, false, false, false);
    graphLayout.setSpacing(true);
    graphLayout.addComponent(graphButtonLayout);
    graphLayout.addComponent(graph);
    graphLayout.setExpandRatio(graph, .9f);

    TabSheet tabSheet = new TabSheet();
    tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL);
    tabSheet.setSizeFull();
    tabSheet.addTab(aboutLayout, "About");
    tabSheet.addTab(graphLayout, "Graph");

    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setMargin(true);
    mainLayout.addComponent(tabSheet);
    mainLayout.setExpandRatio(tabSheet, .9f);

    Window mainWindow = new Window("Arbor-Vaadin");
    mainWindow.setSizeFull();
    mainWindow.setContent(mainLayout);

    setTheme("arbor");

    setMainWindow(mainWindow);
}