List of usage examples for com.vaadin.ui VerticalLayout setSizeFull
@Override public void setSizeFull()
From source file:com.example.vaadin.MyVaadinApplication.java
License:Apache License
public void authenticatedScreen() { VerticalLayout vLayout = new VerticalLayout(); Label label = new Label("Logged in as " + currentUser.getPrincipal().toString()); vLayout.setSizeFull(); vLayout.addComponent(horizontalSplit); /* Allocate all available extra space to the horizontal split panel */ vLayout.setExpandRatio(horizontalSplit, 1); /* Set the initial split position so we can have a 200 pixel menu to the left */ horizontalSplit.setFirstComponent(tree); horizontalSplit.setSplitPosition(200, SplitPanel.UNITS_PIXELS); vLayout.addStyleName("view"); getMainWindow().setContent(vLayout); //this.addComponent(layout); }
From source file:com.expressui.core.MainApplication.java
License:Open Source License
@Override public void init() { currentInstance.set(this); setTheme(getCustomTheme());/*from w w w . ja v a2 s . c o m*/ customizeConfirmDialogStyle(); Window mainWindow = new Window(); setMainWindow(mainWindow); mainWindow.addStyleName("e-main-window"); mainWindow.setCaption(getTypeCaption()); VerticalLayout mainLayout = new VerticalLayout(); String id = StringUtil.generateDebugId("e", this, mainLayout, "mainLayout"); mainLayout.setDebugId(id); mainWindow.setSizeFull(); mainLayout.setSizeFull(); mainWindow.setContent(mainLayout); setLogoutURL(getApplicationProperties().getRestartApplicationUrl()); configureLeftMenuBar(mainMenuBar.getLeftMenuBarRoot()); configureRightMenuBar(mainMenuBar.getRightMenuBarRoot()); mainLayout.addComponent(mainMenuBar); pageLayoutTabSheet = new TabSheet(); id = StringUtil.generateDebugId("e", this, pageLayoutTabSheet, "pageLayoutTabSheet"); pageLayoutTabSheet.setDebugId(id); pageLayoutTabSheet.addStyleName("e-main-page-layout"); pageLayoutTabSheet.setSizeFull(); mainLayout.addComponent(pageLayoutTabSheet); mainLayout.setExpandRatio(pageLayoutTabSheet, 1.0f); Link expressUILink = new Link(uiMessageSource.getMessage("mainApplication.footerMessage"), new ExternalResource(uiMessageSource.getMessage("mainApplication.footerLink"))); expressUILink.setTargetName("_blank"); expressUILink.setIcon(new ThemeResource("../expressui/favicon.png")); expressUILink.setSizeUndefined(); mainLayout.addComponent(expressUILink); mainLayout.setComponentAlignment(expressUILink, Alignment.TOP_CENTER); configureSessionTimeout(mainWindow); postWire(); onDisplay(); }
From source file:com.foc.helpBook.HelpUI.java
License:Apache License
@Override public FocCentralPanel newWindow() { FocCentralPanel focCentralPanel = new FocCentralPanel(); focCentralPanel.fill();/*from w w w. ja v a 2 s . c om*/ Label labelHelpContent = new Label(); labelHelpContent.setContentMode(ContentMode.HTML); String htmlContent = (String) FocWebApplication.getFocWebSession_Static().getParameter("HELP_CONTENT"); labelHelpContent.setValue(htmlContent); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSizeFull(); HorizontalLayout navigationLayout = new HorizontalLayout(); navigationLayout.setWidth("95%"); navigationLayout.addComponent(getPreviousPageButton()); navigationLayout.setComponentAlignment(getPreviousPageButton(), Alignment.BOTTOM_LEFT); navigationLayout.addComponent(getNextPageButton()); navigationLayout.setComponentAlignment(getNextPageButton(), Alignment.BOTTOM_RIGHT); mainLayout.addComponent(labelHelpContent); mainLayout.addComponent(navigationLayout); mainLayout.setComponentAlignment(navigationLayout, Alignment.BOTTOM_CENTER); focCentralPanel.addComponent(mainLayout); return focCentralPanel; }
From source file:com.foc.vaadin.FocWebApplication.java
License:Apache License
protected void init2(VaadinRequest request) { // Create the footer Layout with a simple Label VerticalLayout footerLayout = new VerticalLayout(); {/*w w w . j a va 2 s .co m*/ footerLayout.addComponent(new Label("This is the footer always visible")); footerLayout.setHeight("-1px"); } // Create the Body Panel that contains a VerticalLayout itself Panel panel = new Panel(); { panel.setSizeFull();// Panel size is undefined final VerticalLayout panelLayout = new VerticalLayout(); panelLayout.setSizeUndefined();// Panel Layout size is undefined panel.setContent(panelLayout); // Fill the panel layout with lots of labels to exceed the window height for (int i = 0; i < 200; i++) { panelLayout.addComponent(new Label("Thank you for clicking")); } } // Put all in the the MainVerticalLayout final VerticalLayout mainVerticalLayout = new VerticalLayout(); mainVerticalLayout.setSizeFull();// Main Layout is set to size Full so that it fills all the height mainVerticalLayout.addComponent(panel); mainVerticalLayout.addComponent(footerLayout); mainVerticalLayout.setExpandRatio(panel, 1); setContent(mainVerticalLayout); }
From source file:com.foc.vaadin.FocWebApplication.java
License:Apache License
public void initializeGUI(VaadinRequest vaadinRequest, ServletContext servletContext, HttpSession httpSession) { String path = vaadinRequest != null ? vaadinRequest.getPathInfo() : null; navigationWindow = newWindow();/*ww w . jav a 2 s . co m*/ if (Utils.isStringEmpty(Globals.getApp().getURL())) { if (Page.getCurrent() != null) { URI url = Page.getCurrent().getLocation(); Globals.getApp().setURL(url.toString()); } } applyUserThemeSelection(); if (Globals.isValo() && !isPrintUI()) { navigationWindow.setHeightUndefined(); navigationWindow.setHeight("100%"); FocXMLGuiComponentStatic.setCaptionMargin_Zero(navigationWindow); //PANEL // Panel bodyPanel = new Panel(); // bodyPanel.setSizeFull(); // bodyPanel.setContent(navigationWindow); //----- footerLayout = new VerticalLayout(); footerLayout.setHeight("-1px"); //footerLayout.addComponent(new Label("")); VerticalLayout mainVerticalLayout = new VerticalLayout(); mainVerticalLayout.setSizeFull();// Main Layout is set to size Full so that it fills all the height //PANEL // mainVerticalLayout.addComponent(bodyPanel); // mainVerticalLayout.setExpandRatio(bodyPanel, 1); //----- mainVerticalLayout.addComponent(navigationWindow); mainVerticalLayout.setExpandRatio(navigationWindow, 1); mainVerticalLayout.addComponent(footerLayout); setContent(mainVerticalLayout); } else { setContent(navigationWindow); footerLayout = null; } initAccountFromDataBase(); if (getNavigationWindow() != null) { INavigationWindow window = getNavigationWindow(); URI uri = Page.getCurrent().getLocation(); //Make sure the environment allows unit testing if (ConfigInfo.isUnitAllowed() && uri.getHost().equals("localhost")) { //If there are no test indexes already then we need to check the URL for test request if (!FocUnitDictionary.getInstance().hasNextTest()) { String suiteName = null; String testName = null; if (path != null && path.toLowerCase().startsWith(URL_PARAMETER_KEY_UNIT_SUITE + ":")) { suiteName = path.substring((URL_PARAMETER_KEY_UNIT_SUITE + ":").length()); if (!Utils.isStringEmpty(suiteName)) { int indexOfSuperior = suiteName.indexOf("."); if (indexOfSuperior > 0) { testName = suiteName.substring(indexOfSuperior + 1, suiteName.length()); suiteName = suiteName.substring(0, indexOfSuperior); } FocUnitDictionary.getInstance().initializeCurrentSuiteAndTest(suiteName, testName); } } } if (FocUnitDictionary.getInstance().hasNextTest()) { try { Globals.getApp().setIsUnitTest(true); FocUnitDictionary.getInstance().runSequence(); } catch (Exception e) { Globals.logException(e); } finally { // if( !FocUnitDictionary.getInstance().isPause() // && !FocUnitDictionary.getInstance().isNextTestExist() // ){ // FocUnitDictionary.getInstance().popupLogger(window); // } Globals.getApp().setIsUnitTest(false); } } } } //-------------------------------------------- }
From source file:com.foc.vaadin.gui.components.objectSelectorPopupView.FVObjectSelectorWindow.java
License:Apache License
private void init() { setModal(true);//from ww w . jav a 2 s . com setResizable(false); setWidth("400px"); setHeight("200px"); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSizeFull(); verticalLayout.addComponent(getMainHorizontalLayout()); verticalLayout.setComponentAlignment(getMainHorizontalLayout(), Alignment.MIDDLE_CENTER); setContent(verticalLayout); }
From source file:com.freebox.engeneering.application.web.common.ApplicationLayout.java
License:Apache License
/** * Initializes view layout when system enters 'initView' action state. *//from w w w.j a va2 s.c o m * @param event - state event. */ public void initView(@SuppressWarnings("rawtypes") StateEvent event) { final HorizontalLayout content = new HorizontalLayout(); content.setSizeFull(); content.setStyleName("main-view"); final HorizontalSplitPanel leftSplitPanel = new HorizontalSplitPanel(); leftSplitPanel.setSplitPosition(20, Sizeable.Unit.PERCENTAGE); final ComponentContainer leftSideBar = createPlaceholder(StateLayout.LEFT_SIDE_BAR); leftSideBar.setSizeFull(); content.addComponent(leftSideBar, 0); final VerticalLayout verticalLayoutContent = new VerticalLayout(); verticalLayoutContent.setStyleName("freebox-view"); verticalLayoutContent.addComponent(createPlaceholder(StateLayout.HEADER)); verticalLayoutContent.setSpacing(true); final ComponentContainer layoutContent = createPlaceholder(StateLayout.CONTENT); layoutContent.setSizeFull(); verticalLayoutContent.addComponent(layoutContent); verticalLayoutContent.setSizeFull(); //verticalLayoutContent.addComponent(createPlaceholder(StateLayout.FOOTER)); verticalLayoutContent.setExpandRatio(layoutContent, 8f); content.addComponent(verticalLayoutContent, 1); content.setExpandRatio(leftSideBar, 1.0f); content.setExpandRatio(verticalLayoutContent, 9f); setView(content); }
From source file:com.github.carljmosca.ui.EventsView.java
@PostConstruct private void init() { sdf = new SimpleDateFormat("MM/dd/yy HH:mm"); setCaption("Events"); grid = new Grid<>(Events.class); grid.addColumn(p -> p.getName() + ": " + sdf.format(p.getStartTime()) + " " + p.getCause()) .setCaption("Name/Start").setId("nameAndStart"); grid.setColumns("nameAndStart"); grid.setHeightMode(HeightMode.ROW);/*from w w w.ja v a2 s . c om*/ grid.setHeightByRows(10.0d); grid.setSelectionMode(Grid.SelectionMode.SINGLE); grid.addSelectionListener((SelectionEvent<Events> event) -> { DemoUI demoUI = (DemoUI) UI.getCurrent(); demoUI.setEventId(grid.getSelectedItems().stream().findFirst().get().getEventsPK().getId()); getNavigationManager().navigateTo(framesView); }); grid.setSizeUndefined(); VerticalLayout gridLayout = new VerticalLayout(grid); gridLayout.setSizeFull(); SimpleDateFormat dtf = new SimpleDateFormat("yy-MM-dd hh:mm"); setContent(gridLayout); }
From source file:com.github.djabry.platform.vaadin.ui.MainUI.java
License:Open Source License
@Override protected void init(VaadinRequest request) { VerticalLayout rootLayout = new VerticalLayout(); rootLayout.setSizeFull(); setContent(rootLayout);//from w w w . ja va 2 s . c o m BannerView banner = bannerPresenter.getView(); rootLayout.addComponent(banner); HorizontalLayout mainLayout = new HorizontalLayout(); mainLayout.setSizeFull(); body = new VerticalLayout(); body.setSizeFull(); Navigator navigator = new Navigator(this, body); navigator.addProvider(vP); this.setNavigator(navigator); SideBarView sidebarView = sideBarPresenter.getView(); mainLayout.addComponent(sidebarView); mainLayout.addComponent(body); rootLayout.addComponent(mainLayout); rootLayout.setExpandRatio(mainLayout, 10); sidebarView.setWidth(150, Unit.PIXELS); mainLayout.setExpandRatio(body, 10); //rootLayout.setSplitPosition(150, Unit.PIXELS); navigator.navigateTo(LoginView.VIEW_NAME); eventBus.publish(EventScope.SESSION, this, Action.START); }
From source file:com.github.djabry.platform.vaadin.view.SideBarView.java
License:Open Source License
@PostConstruct public void init() { this.setSizeFull(); HorizontalLayout titleHolder = new HorizontalLayout(); titleHolder.addComponent(buildTitle()); titleHolder.addStyleName(ValoTheme.LAYOUT_WELL); //titleHolder.setMargin(true); //titleHolder.setSpacing(true); //this.addComponent(titleHolder); VerticalLayout sidebarHolder = new VerticalLayout(); //sidebarHolder.addStyleName(ValoTheme.LAYOUT_WELL); sidebarHolder.addStyleName(ValoTheme.MENU_ROOT); //sidebarHolder.addStyleName(ValoTheme.MENUBAR_BORDERLESS); this.addComponent(sidebarHolder); sidebarHolder.setSizeFull(); sidebarHolder.addComponent(sideBar); //sideBar.setStyleName(ValoTheme.ACCORDION_BORDERLESS); sideBar.addStyleName(ValoTheme.MENU_PART); sideBar.setSizeFull();// ww w.ja va 2 s . c o m }