List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout
public VerticalLayout()
From source file:com.foc.helpBook.HelpUI.java
License:Apache License
@Override public FocCentralPanel newWindow() { FocCentralPanel focCentralPanel = new FocCentralPanel(); focCentralPanel.fill();/* w w w . j a va 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(); {/*from w w w . ja v a2 s. c o 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();/* www. j av a 2s . 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);/* ww w . ja va2s.c om*/ 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.foc.vaadin.gui.components.upload.FVUpload_Document.java
License:Apache License
public FVUpload_Document() { root = new VerticalLayout(); root.setSpacing(false);//from w ww . j a v a 2 s .c o m root.setMargin(false); setCompositionRoot(root); // Create the Upload component. upload = new Upload(null, this); upload.setImmediate(true); upload.setButtonCaption("Upload"); upload.addSucceededListener((Upload.SucceededListener) this); upload.addFailedListener((Upload.FailedListener) this); root.addComponent(upload); }
From source file:com.foc.vaadin.gui.components.upload.FVUpload_Image.java
License:Apache License
public FVUpload_Image() { root = new VerticalLayout(); root.setSpacing(false);/*from w w w .j ava 2 s .c o m*/ root.setMargin(false); setCompositionRoot(root); // Create the Upload component. upload = new Upload(null, this); upload.setImmediate(true); // upload.addStyleName("focUpload"); if (ConfigInfo.isArabic()) { upload.setButtonCaption("");//To hide the default ugly button we should set this to null } else { upload.setButtonCaption("Upload");//To hide the default ugly button we should set this to null } // Use a custom button caption instead of plain "Upload". //upload.setButtonCaption(null); /* uploadButton = new FVButton("", new Button.ClickListener() { public void buttonClick(ClickEvent event) { if(upload != null) upload.startUpload(); } }); uploadButton.setIcon(new ThemeResource("../runo/icons/32/document-add.png")); uploadButton.setStyleName(BaseTheme.BUTTON_LINK); */ // Listen for events regarding the success of upload. upload.addSucceededListener((Upload.SucceededListener) this); upload.addFailedListener((Upload.FailedListener) this); upload.addStartedListener((Upload.StartedListener) this); root.addComponent(upload); root.setComponentAlignment(upload, Alignment.TOP_RIGHT); // uploadButton = new Button(); // uploadButton.setIcon(FVIconFactory.getInstance().getFVIcon_24(FVIconFactory.ICON_UPLOAD)); // uploadButton.setDescription("Upload"); // uploadButton.addClickListener(new Button.ClickListener() { // @Override // public void buttonClick(ClickEvent event) { // if(upload != null){ // upload.submitUpload(); // } // } // }); // root.addComponent(uploadButton); }
From source file:com.foc.vaadin.gui.layouts.FVChartWrapperLayout.java
License:Apache License
private void setChart(FVChart chart) { this.chart = chart; if (chart != null) { chartPanel = new Panel(); VerticalLayout vLay = new VerticalLayout(); vLay.setMargin(false);// w w w . j a v a 2 s .c o m vLay.setSpacing(false); chartPanel.setContent(vLay); chartPanel.setContent(chart); addComponent(chart); } }
From source file:com.foc.vaadin.gui.layouts.FVHTMLLayout.java
License:Apache License
public void init() { rootVerticalLayout = new VerticalLayout(); setCompositionRoot(rootVerticalLayout); delegate = new FocXMLGuiComponentDelegate(this); addStyleName(FVLayout.DEFAULT_STYLE); }
From source file:com.foc.vaadin.gui.layouts.FVTabbedLayout.java
License:Apache License
public FVTabbedLayout(Attributes attributes) { delegate = new FocXMLGuiComponentDelegate(this); setAttributes(attributes);/*from ww w . j a va2 s .com*/ addTabLayout = new VerticalLayout(); if (delegate.isConstructionMode()) { addTabButton = new Button("Add Tab"); addTabButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { if (isDragDropEnabled) addNewTab(); } }); addTabLayout.addComponent(addTabButton); addTab(addTabLayout, "+"); } addStyleName(FVLayout.DEFAULT_STYLE); }
From source file:com.foc.vaadin.gui.windows.AddTabWindow.java
License:Apache License
public AddTabWindow(final TabSheet tabSheet, final VerticalLayout addTabLayout) { super("Add New Tab"); setModal(true);/*from w w w . j a va 2s . com*/ setWidth("264px"); setHeight("272px"); layout = new VerticalLayout(); buttonsLayout = new HorizontalLayout(); optionsLayout = new VerticalLayout(); seperateLayout = new VerticalLayout(); tabName = new TextField(); tabNameWrapper = new FVWrapperLayout(tabName, "Tab Name:", width); layoutHeight = new TextField(); heightWrapper = new FVWrapperLayout(layoutHeight, "Height:", width); layoutWidth = new TextField(); widthWrapper = new FVWrapperLayout(layoutWidth, "Width:", width); innerLayout = new ComboBox(); innerLayoutWrapper = new FVWrapperLayout(innerLayout, "Layout Type:", width); for (int i = 0; i < layoutTypes.length; i++) { innerLayout.addItem(layoutTypes[i]); } innerLayout.setImmediate(true); innerLayout.setNullSelectionAllowed(false); innerLayout.setValue(layoutTypes[0]); innerLayout.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { String layoutType = event.getProperty().toString(); if (layoutType.equals(FXML.TAG_GRID_LAYOUT)) { layoutCols = new TextField(); colsWrapper = new FVWrapperLayout(layoutCols, "Columns:", width); layoutRows = new TextField(); rowsWrapper = new FVWrapperLayout(layoutRows, "Rows:", width); optionsLayout.addComponent(colsWrapper); optionsLayout.addComponent(rowsWrapper); setHeight("350px"); } else { if (layoutCols != null) { optionsLayout.removeComponent(colsWrapper); layoutCols = null; colsWrapper = null; } if (layoutRows != null) { optionsLayout.removeComponent(rowsWrapper); layoutRows = null; rowsWrapper = null; } setHeight("272px"); } } }); create = new Button("Create"); cancel = new Button("Cancel"); cancel.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); create.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { String layoutType = innerLayout.getValue().toString(); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "name", "name", "CDATA", "null"); attributes.addAttribute("", "height", "height", "CDATA", layoutHeight.getValue().toString().isEmpty() ? "-1px" : layoutHeight.getValue().toString() + "px"); attributes.addAttribute("", "width", "width", "CDATA", layoutWidth.getValue().toString().isEmpty() ? "-1px" : layoutWidth.getValue().toString() + "px"); if (layoutType.equals(FXML.TAG_ABSOLUTE_LAYOUT)) { selectedLayout = new FVAbsoluteLayout(attributes); } else if (layoutType.equals(FXML.TAG_VERTICAL_LAYOUT)) { selectedLayout = new FVVerticalLayout(attributes); } else if (layoutType.equals(FXML.TAG_HORIZONTAL_LAYOUT)) { selectedLayout = new FVHorizontalLayout(attributes); } else { attributes.addAttribute("", "rows", "rows", "CDATA", layoutRows.getValue().toString()); attributes.addAttribute("", "cols", "cols", "CDATA", layoutCols.getValue().toString()); selectedLayout = new FVGridLayout(attributes); } tabSheet.removeTab(tabSheet.getTab(addTabLayout)); tabSheet.addTab((Component) selectedLayout, tabName.getValue().toString()); tabSheet.addTab(addTabLayout, "+"); close(); } }); optionsLayout.setSpacing(true); optionsLayout.addComponent(widthWrapper); optionsLayout.addComponent(heightWrapper); seperateLayout.setHeight("25px"); buttonsLayout.setSpacing(true); buttonsLayout.addComponent(create); buttonsLayout.addComponent(cancel); layout.setSpacing(true); layout.addComponent(tabNameWrapper); layout.addComponent(innerLayoutWrapper); layout.addComponent(optionsLayout); layout.addComponent(seperateLayout); layout.addComponent(buttonsLayout); layout.setComponentAlignment(buttonsLayout, Alignment.MIDDLE_CENTER); setContent(layout); }