List of usage examples for com.vaadin.ui VerticalLayout setVisible
@Override public void setVisible(boolean visible)
From source file:at.peppol.webgui.app.components.InvoiceLineAllowanceChargeForm.java
License:Mozilla Public License
private void initElements() { final GridLayout grid = new GridLayout(4, 4); final VerticalLayout outerLayout = new VerticalLayout(); hiddenContent = new VerticalLayout(); hiddenContent.setSpacing(true);// w w w .j ava 2 s . c om hiddenContent.setMargin(true); table = new InvoiceLineAllowanceChargeTable(lineAllowanceChargeList); table.setSelectable(true); table.setImmediate(true); table.setNullSelectionAllowed(false); table.setHeight(150, UNITS_PIXELS); table.setFooterVisible(false); table.addStyleName("striped strong"); VerticalLayout tableContainer = new VerticalLayout(); tableContainer.addComponent(table); tableContainer.setMargin(false, true, false, false); Button addButton = new Button("Add new"); Button editButton = new Button("Edit selected"); Button deleteButton = new Button("Delete selected"); VerticalLayout buttonsContainer = new VerticalLayout(); buttonsContainer.setSpacing(true); buttonsContainer.addComponent(addButton); buttonsContainer.addComponent(editButton); buttonsContainer.addComponent(deleteButton); InvoiceLineAllowanceChargeTableEditor editor = new InvoiceLineAllowanceChargeTableEditor(editMode, inv); Label label = new Label("<h3>Adding allowance/charge line</h3>", Label.CONTENT_XHTML); addButton.addListener(editor.addButtonListener(editButton, deleteButton, hiddenContent, table, lineAllowanceChargeList, label)); label = new Label("<h3>Edit allowance/charge line</h3>", Label.CONTENT_XHTML); editButton.addListener(editor.editButtonListener(addButton, deleteButton, hiddenContent, table, lineAllowanceChargeList, label)); deleteButton.addListener(editor.deleteButtonListener(table)); Panel outerPanel = new Panel(prefix + " Allowances/Charges"); //outerPanel.setStyleName("light"); // ---- HIDDEN FORM BEGINS ----- VerticalLayout formLayout = new VerticalLayout(); formLayout.addComponent(hiddenContent); hiddenContent.setVisible(false); // ---- HIDDEN FORM ENDS ----- grid.setSizeUndefined(); grid.addComponent(tableContainer, 0, 0); grid.addComponent(buttonsContainer, 1, 0); outerPanel.addComponent(grid); outerPanel.addComponent(formLayout); outerLayout.addComponent(outerPanel); outerPanel.requestRepaintAll(); VerticalLayout mainLayout = new VerticalLayout(); final VerticalLayout showHideContentLayout = new VerticalLayout(); showHideContentLayout.addComponent(outerPanel); HorizontalLayout showHideButtonLayout = new HorizontalLayout(); Button btn = new Button("Show/Hide Allowances/Charges", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // TODO Auto-generated method stub showHideContentLayout.setVisible(!showHideContentLayout.isVisible()); } }); showHideButtonLayout.setWidth("100%"); showHideButtonLayout.addComponent(btn); showHideButtonLayout.setComponentAlignment(btn, Alignment.MIDDLE_RIGHT); //mainLayout.addComponent(showHideButtonLayout); mainLayout.addComponent(showHideContentLayout); //showHideContentLayout.setVisible(false); addComponent(mainLayout); }
From source file:at.peppol.webgui.app.components.InvoiceLineCommodityClassificationForm.java
License:Mozilla Public License
private void initElements() { final GridLayout grid = new GridLayout(4, 4); final VerticalLayout outerLayout = new VerticalLayout(); hiddenContent = new VerticalLayout(); hiddenContent.setSpacing(true);//from w w w .j a va 2 s . c om hiddenContent.setMargin(true); table = new InvoiceLineCommodityClassificationTable(lineCommodityList); table.setSelectable(true); table.setImmediate(true); table.setNullSelectionAllowed(false); table.setHeight(150, UNITS_PIXELS); table.setFooterVisible(false); table.addStyleName("striped strong"); VerticalLayout tableContainer = new VerticalLayout(); tableContainer.addComponent(table); tableContainer.setMargin(false, true, false, false); Button addButton = new Button("Add new"); Button editButton = new Button("Edit selected"); Button deleteButton = new Button("Delete selected"); VerticalLayout buttonsContainer = new VerticalLayout(); buttonsContainer.setSpacing(true); buttonsContainer.addComponent(addButton); buttonsContainer.addComponent(editButton); buttonsContainer.addComponent(deleteButton); InvoiceLineCommodityClassificationTableEditor editor = new InvoiceLineCommodityClassificationTableEditor( editMode); Label label = new Label("<h3>Adding commodity classification line</h3>", Label.CONTENT_XHTML); addButton.addListener( editor.addButtonListener(editButton, deleteButton, hiddenContent, table, lineCommodityList, label)); label = new Label("<h3>Edit commodity classification line</h3>", Label.CONTENT_XHTML); editButton.addListener( editor.editButtonListener(addButton, deleteButton, hiddenContent, table, lineCommodityList, label)); deleteButton.addListener(editor.deleteButtonListener(table)); Panel outerPanel = new Panel(prefix + " Commodity Classifications"); //outerPanel.setStyleName("light"); // ---- HIDDEN FORM BEGINS ----- VerticalLayout formLayout = new VerticalLayout(); formLayout.addComponent(hiddenContent); hiddenContent.setVisible(false); // ---- HIDDEN FORM ENDS ----- grid.setSizeUndefined(); grid.addComponent(tableContainer, 0, 0); grid.addComponent(buttonsContainer, 1, 0); outerPanel.addComponent(grid); outerPanel.addComponent(formLayout); outerLayout.addComponent(outerPanel); outerPanel.requestRepaintAll(); VerticalLayout mainLayout = new VerticalLayout(); final VerticalLayout showHideContentLayout = new VerticalLayout(); showHideContentLayout.addComponent(outerPanel); HorizontalLayout showHideButtonLayout = new HorizontalLayout(); Button btn = new Button("Show/Hide Allowances/Charges", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // TODO Auto-generated method stub showHideContentLayout.setVisible(!showHideContentLayout.isVisible()); } }); showHideButtonLayout.setWidth("100%"); showHideButtonLayout.addComponent(btn); showHideButtonLayout.setComponentAlignment(btn, Alignment.MIDDLE_RIGHT); //mainLayout.addComponent(showHideButtonLayout); mainLayout.addComponent(showHideContentLayout); //showHideContentLayout.setVisible(false); addComponent(mainLayout); }
From source file:at.peppol.webgui.app.components.InvoiceLineOrderForm.java
License:Mozilla Public License
private void initElements() { final GridLayout grid = new GridLayout(4, 4); final VerticalLayout outerLayout = new VerticalLayout(); hiddenContent = new VerticalLayout(); hiddenContent.setSpacing(true);//from w w w . j av a2 s . com hiddenContent.setMargin(true); table = new InvoiceLineOrderReferenceTable(lineOrderList); table.setSelectable(true); table.setImmediate(true); table.setNullSelectionAllowed(false); table.setHeight(150, UNITS_PIXELS); table.setFooterVisible(false); table.addStyleName("striped strong"); VerticalLayout tableContainer = new VerticalLayout(); tableContainer.addComponent(table); tableContainer.setMargin(false, true, false, false); Button addButton = new Button("Add new"); Button editButton = new Button("Edit selected"); Button deleteButton = new Button("Delete selected"); VerticalLayout buttonsContainer = new VerticalLayout(); buttonsContainer.setSpacing(true); buttonsContainer.addComponent(addButton); buttonsContainer.addComponent(editButton); buttonsContainer.addComponent(deleteButton); InvoiceLineOrderReferenceTableEditor editor = new InvoiceLineOrderReferenceTableEditor(editMode); Label label = new Label("<h3>Adding order line</h3>", Label.CONTENT_XHTML); addButton.addListener( editor.addButtonListener(editButton, deleteButton, hiddenContent, table, lineOrderList, label)); label = new Label("<h3>Edit order line</h3>", Label.CONTENT_XHTML); editButton.addListener( editor.editButtonListener(addButton, deleteButton, hiddenContent, table, lineOrderList, label)); deleteButton.addListener(editor.deleteButtonListener(table)); Panel outerPanel = new Panel(prefix + " Referencing Orders"); //outerPanel.setStyleName("light"); // ---- HIDDEN FORM BEGINS ----- VerticalLayout formLayout = new VerticalLayout(); formLayout.addComponent(hiddenContent); hiddenContent.setVisible(false); // ---- HIDDEN FORM ENDS ----- grid.setSizeUndefined(); grid.addComponent(tableContainer, 0, 0); grid.addComponent(buttonsContainer, 1, 0); outerPanel.addComponent(grid); outerPanel.addComponent(formLayout); outerLayout.addComponent(outerPanel); outerPanel.requestRepaintAll(); VerticalLayout mainLayout = new VerticalLayout(); final VerticalLayout showHideContentLayout = new VerticalLayout(); showHideContentLayout.addComponent(outerPanel); HorizontalLayout showHideButtonLayout = new HorizontalLayout(); Button btn = new Button("Show/Hide Allowances/Charges", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // TODO Auto-generated method stub showHideContentLayout.setVisible(!showHideContentLayout.isVisible()); } }); showHideButtonLayout.setWidth("100%"); showHideButtonLayout.addComponent(btn); showHideButtonLayout.setComponentAlignment(btn, Alignment.MIDDLE_RIGHT); //mainLayout.addComponent(showHideButtonLayout); mainLayout.addComponent(showHideContentLayout); //showHideContentLayout.setVisible(false); addComponent(mainLayout); }
From source file:at.peppol.webgui.app.components.ItemPropertyForm.java
License:Mozilla Public License
private void initElements() { final GridLayout grid = new GridLayout(4, 4); final VerticalLayout outerLayout = new VerticalLayout(); hiddenContent = new VerticalLayout(); hiddenContent.setSpacing(true);//from www.ja v a2 s. c om hiddenContent.setMargin(true); table = new InvoiceItemPropertyTable(itemPropertyBeanList); table.setSelectable(true); table.setImmediate(true); table.setNullSelectionAllowed(false); table.setHeight(150, UNITS_PIXELS); table.setFooterVisible(false); table.addStyleName("striped strong"); VerticalLayout tableContainer = new VerticalLayout(); tableContainer.addComponent(table); tableContainer.setMargin(false, true, false, false); Button addButton = new Button("Add new"); Button editButton = new Button("Edit selected"); Button deleteButton = new Button("Delete selected"); VerticalLayout buttonsContainer = new VerticalLayout(); buttonsContainer.setSpacing(true); buttonsContainer.addComponent(addButton); buttonsContainer.addComponent(editButton); buttonsContainer.addComponent(deleteButton); InvoiceItemPropertyTableEditor editor = new InvoiceItemPropertyTableEditor(editMode); Label label = new Label("<h3>Adding new item property</h3>", Label.CONTENT_XHTML); addButton.addListener(editor.addButtonListener(editButton, deleteButton, hiddenContent, table, itemPropertyBeanList, label)); label = new Label("<h3>Edit item property</h3>", Label.CONTENT_XHTML); editButton.addListener(editor.editButtonListener(addButton, deleteButton, hiddenContent, table, itemPropertyBeanList, label)); deleteButton.addListener(editor.deleteButtonListener(table)); Panel outerPanel = new Panel(itemPropertyPrefix + " Item Properties"); //outerPanel.setStyleName("light"); // ---- HIDDEN FORM BEGINS ----- VerticalLayout formLayout = new VerticalLayout(); formLayout.addComponent(hiddenContent); hiddenContent.setVisible(false); // ---- HIDDEN FORM ENDS ----- grid.setSizeUndefined(); grid.addComponent(tableContainer, 0, 0); grid.addComponent(buttonsContainer, 1, 0); outerPanel.addComponent(grid); outerPanel.addComponent(formLayout); outerLayout.addComponent(outerPanel); outerPanel.requestRepaintAll(); VerticalLayout mainLayout = new VerticalLayout(); final VerticalLayout showHideContentLayout = new VerticalLayout(); showHideContentLayout.addComponent(outerPanel); HorizontalLayout showHideButtonLayout = new HorizontalLayout(); Button btn = new Button("Show/Hide Additional Item Property", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // TODO Auto-generated method stub showHideContentLayout.setVisible(!showHideContentLayout.isVisible()); } }); showHideButtonLayout.setWidth("100%"); showHideButtonLayout.addComponent(btn); showHideButtonLayout.setComponentAlignment(btn, Alignment.MIDDLE_RIGHT); //mainLayout.addComponent(showHideButtonLayout); mainLayout.addComponent(showHideContentLayout); //showHideContentLayout.setVisible(false); addComponent(mainLayout); }
From source file:be.rvponp.build.CommitViewerUI.java
License:Apache License
@Override protected void init(VaadinRequest vaadinRequest) { VerticalLayout layout = new VerticalLayout(); VerticalLayout infoLayout = new VerticalLayout(); layout.setSizeFull();/*from w w w . j ava 2 s .c om*/ HorizontalLayout buildDateLayout = createBuildDateLayout(); infoLayout.addComponent(buildDateLayout); table = createCommitsTable(); files = new VerticalLayout(); Label filesLabel = new Label("Files"); VerticalLayout filesLayout = new VerticalLayout(); HorizontalLayout filtersLayout = createFiltersLayout(table, files, filesLayout); VerticalLayout tableLayout = new VerticalLayout(); tableLayout.addComponent(table); tableLayout.setSizeFull(); filesLayout.addComponent(filesLabel); filesLayout.addComponent(files); filesLayout.setVisible(false); filesLayout.setSizeFull(); infoLayout.addComponent(new Panel(filtersLayout)); infoLayout.setSizeUndefined(); layout.addComponent(infoLayout); layout.addComponent(tableLayout); layout.setExpandRatio(tableLayout, 1); layout.addComponent(filesLayout); layout.setExpandRatio(filesLayout, 0); layout.addComponent(new ExportXLSButton("Export XLS", table, fromVersion, toVersion)); layout.setMargin(true); setContent(layout); }
From source file:com.antonjohansson.lprs.view.ServiceView.java
License:Apache License
private Layout requestTokenLayout() { username.setInputPrompt("Username"); username.setWidth(STANDARD_WIDTH, EM); captcha.setSize(NORMAL);//from w w w. j a va 2 s . com captcha.setTheme(LIGHT); captcha.setType(IMAGE); requestToken.setCaption("Request token"); requestToken.setWidth(STANDARD_WIDTH, EM); requestToken.setEnabled(false); VerticalLayout layout = new VerticalLayout(); layout.addComponents(username, captcha, requestToken); layout.setMargin(true); layout.setSpacing(true); layout.setVisible(false); layout.setWidthUndefined(); return layout; }
From source file:com.antonjohansson.lprs.view.ServiceView.java
License:Apache License
private Layout useTokenLayout() { token.setInputPrompt("Token"); token.setWidth(STANDARD_WIDTH, EM);/*w w w. j a v a2s. c o m*/ useToken.setCaption("Next"); backFromUseToken.setCaption("Back"); HorizontalLayout buttons = new HorizontalLayout(useToken, backFromUseToken); buttons.setSpacing(true); VerticalLayout layout = new VerticalLayout(); layout.addComponents(greeting, token, buttons); layout.setMargin(true); layout.setSpacing(true); layout.setVisible(false); layout.setWidthUndefined(); return layout; }
From source file:com.antonjohansson.lprs.view.ServiceView.java
License:Apache License
private Layout setPasswordLayout() { newPassword.setWidth(STANDARD_WIDTH, EM); newPassword.setCaption("Password"); newPasswordRepeat.setWidth(STANDARD_WIDTH, EM); newPasswordRepeat.setCaption("Repeat password"); setPassword.setCaption("Set password"); backFromSetPassword.setCaption("Back"); HorizontalLayout buttons = new HorizontalLayout(setPassword, backFromSetPassword); buttons.setSpacing(true);//from ww w .ja va 2s. c o m VerticalLayout layout = new VerticalLayout(); layout.addComponents(newPassword, newPasswordRepeat, buttons); layout.setMargin(true); layout.setSpacing(true); layout.setVisible(false); layout.setWidthUndefined(); return layout; }
From source file:com.skysql.manager.ui.PanelInfo.java
License:Open Source License
/** * Creates the charts layout.// w w w .jav a2s . com */ private void createChartsLayout() { chartsLayout = new VerticalLayout(); chartsLayout.addStyleName("chartsLayout"); chartsLayout.setHeight("100%"); chartsLayout.setSpacing(true); addComponent(chartsLayout); final HorizontalLayout chartsHeaderLayout = new HorizontalLayout(); chartsHeaderLayout.setStyleName("panelHeaderLayout"); chartsHeaderLayout.setWidth("100%"); chartsHeaderLayout.setSpacing(true); chartsHeaderLayout.setMargin(new MarginInfo(false, true, false, true)); chartsLayout.addComponent(chartsHeaderLayout); chartControls = new ChartControls(); chartControls.addIntervalSelectionListener(chartIntervalListener); chartControls.addThemeSelectionListener(chartThemeListener); chartsHeaderLayout.addComponent(chartControls); chartsHeaderLayout.setComponentAlignment(chartControls, Alignment.MIDDLE_LEFT); final HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setSpacing(true); chartsHeaderLayout.addComponent(buttonsLayout); chartsHeaderLayout.setComponentAlignment(buttonsLayout, Alignment.MIDDLE_RIGHT); SettingsDialog settingsDialog = new SettingsDialog("Edit Monitors...", "Monitors"); final Button editMonitorsButton = settingsDialog.getButton(); editMonitorsButton.setVisible(false); buttonsLayout.addComponent(editMonitorsButton); final Button addChartButton = new Button("Add Chart..."); addChartButton.setVisible(false); buttonsLayout.addComponent(addChartButton); addChartButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { new ChartsDialog(chartsArrayLayout, null); } }); final Button editButton = new Button("Edit"); editButton.setDescription("Enter Editing mode"); final Button saveButton = new Button("Done"); saveButton.setDescription("Exit Editing mode"); buttonsLayout.addComponent(editButton); editButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { buttonsLayout.replaceComponent(editButton, saveButton); chartsArrayLayout.setDragMode(LayoutDragMode.CLONE); chartsArrayLayout.setEditable(true); chartsHeaderLayout.setStyleName("panelHeaderLayout-editable"); editMonitorsButton.setVisible(true); addChartButton.setVisible(true); OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class); overviewPanel.setEnabled(false); } }); saveButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { buttonsLayout.replaceComponent(saveButton, editButton); chartsArrayLayout.setDragMode(LayoutDragMode.NONE); chartsArrayLayout.setEditable(false); chartsHeaderLayout.setStyleName("panelHeaderLayout"); editMonitorsButton.setVisible(false); addChartButton.setVisible(false); OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class); overviewPanel.setEnabled(true); refresh(); } }); final Button expandButton = new NativeButton(); expandButton.setStyleName("expandButton"); expandButton.setDescription("Expand/Reduce viewing area"); buttonsLayout.addComponent(expandButton); buttonsLayout.setComponentAlignment(expandButton, Alignment.MIDDLE_CENTER); expandButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { isExpanded = !isExpanded; AnimatorProxy proxy = getSession().getAttribute(AnimatorProxy.class); proxy.addListener(new AnimationListener() { public void onAnimation(AnimationEvent event) { Component component = event.getComponent(); component.setVisible(isExpanded ? false : true); } }); // OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class); // if (!isExpanded) { // overviewPanel.setVisible(isExpanded ? false : true); // } // proxy.animate(overviewPanel, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN).setDuration(500).setDelay(100); // // TopPanel topPanel = getSession().getAttribute(TopPanel.class); // if (!isExpanded) { // topPanel.setVisible(isExpanded ? false : true); // } // proxy.animate(topPanel, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN).setDuration(500).setDelay(100); VerticalLayout topMid = getSession().getAttribute(VerticalLayout.class); if (!isExpanded) { topMid.setVisible(isExpanded ? false : true); } proxy.animate(topMid, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN) .setDuration(500).setDelay(100); expandButton.setStyleName(isExpanded ? "contractButton" : "expandButton"); } }); chartsPanel = new Panel(); chartsPanel.setSizeFull(); chartsPanel.addStyleName(Runo.PANEL_LIGHT); chartsLayout.addComponent(chartsPanel); chartsLayout.setExpandRatio(chartsPanel, 1.0f); }
From source file:edu.cornell.qatarmed.planrnaseq.PlanRNAseq.java
private void initLayout() { /* Root of the user interface component tree is set */ HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); setContent(splitPanel);/*from ww w . j a v a 2 s. co m*/ /* Build the component tree */ VerticalLayout leftLayout = new VerticalLayout(); VerticalLayout rightLayout = new VerticalLayout(); splitPanel.addComponent(leftLayout); splitPanel.addComponent(rightLayout); //make form asking parameters and add it to leftLaayout VerticalLayout formLayout = new VerticalLayout(); TextField studyName = new TextField("Name of RNAseq Study"); formLayout.addComponent(studyName); List replist = new ArrayList(); ComboBox numReplicates = new ComboBox("Replicates", replist); formLayout.addComponent(numReplicates); leftLayout.addComponent(formLayout); /* Set the contents in the left of the split panel to use all the space */ leftLayout.setSizeFull(); VerticalLayout resultLayout = new VerticalLayout(); rightLayout.addComponent(resultLayout); VerticalLayout chartLayout = new VerticalLayout(); rightLayout.addComponent(chartLayout); chartLayout.setVisible(false); }