List of usage examples for com.vaadin.ui VerticalLayout setWidth
@Override public void setWidth(String width)
From source file:annis.gui.controlpanel.QueryPanel.java
License:Apache License
public QueryPanel(final AnnisUI ui) { super(4, 5);// www . j a v a 2s . co m this.ui = ui; this.lastPublicStatus = "Welcome to ANNIS! " + "A tutorial is available on the right side."; this.state = ui.getQueryState(); setSpacing(true); setMargin(false); setRowExpandRatio(0, 1.0f); setColumnExpandRatio(0, 0.0f); setColumnExpandRatio(1, 0.1f); setColumnExpandRatio(2, 0.0f); setColumnExpandRatio(3, 0.0f); txtQuery = new AqlCodeEditor(); txtQuery.setPropertyDataSource(state.getAql()); txtQuery.setInputPrompt("Please enter AQL query"); txtQuery.addStyleName("query"); if (ui.getInstanceFont() == null) { txtQuery.addStyleName("default-query-font"); txtQuery.setTextareaStyle("default-query-font"); } else { txtQuery.addStyleName(Helper.CORPUS_FONT); txtQuery.setTextareaStyle(Helper.CORPUS_FONT); } txtQuery.addStyleName("keyboardInput"); txtQuery.setWidth("100%"); txtQuery.setHeight(15f, Unit.EM); txtQuery.setTextChangeTimeout(500); final VirtualKeyboardCodeEditor virtualKeyboard; if (ui.getInstanceConfig().getKeyboardLayout() == null) { virtualKeyboard = null; } else { virtualKeyboard = new VirtualKeyboardCodeEditor(); virtualKeyboard.setKeyboardLayout(ui.getInstanceConfig().getKeyboardLayout()); virtualKeyboard.extend(txtQuery); } txtStatus = new TextArea(); txtStatus.setValue(this.lastPublicStatus); txtStatus.setWidth("100%"); txtStatus.setHeight(4.0f, Unit.EM); txtStatus.addStyleName("border-layout"); txtStatus.setReadOnly(true); piCount = new ProgressBar(); piCount.setIndeterminate(true); piCount.setEnabled(false); piCount.setVisible(false); btShowResult = new Button("Search"); btShowResult.setIcon(FontAwesome.SEARCH); btShowResult.setWidth("100%"); btShowResult.addClickListener(new ShowResultClickListener()); btShowResult.setDescription("<strong>Show Result</strong><br />Ctrl + Enter"); btShowResult.setClickShortcut(KeyCode.ENTER, ModifierKey.CTRL); btShowResult.setDisableOnClick(true); VerticalLayout historyListLayout = new VerticalLayout(); historyListLayout.setSizeUndefined(); lstHistory = new ListSelect(); lstHistory.setWidth("200px"); lstHistory.setNullSelectionAllowed(false); lstHistory.setValue(null); lstHistory.addValueChangeListener((ValueChangeListener) this); lstHistory.setImmediate(true); lstHistory.setContainerDataSource(historyContainer); lstHistory.setItemCaptionPropertyId("query"); lstHistory.addStyleName(Helper.CORPUS_FONT); Button btShowMoreHistory = new Button("Show more details", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { if (historyWindow == null) { historyWindow = new Window("History"); historyWindow.setModal(false); historyWindow.setWidth("400px"); historyWindow.setHeight("250px"); } historyWindow.setContent(new HistoryPanel(state.getHistory(), ui.getQueryController())); if (UI.getCurrent().getWindows().contains(historyWindow)) { historyWindow.bringToFront(); } else { UI.getCurrent().addWindow(historyWindow); } } }); btShowMoreHistory.setWidth("100%"); historyListLayout.addComponent(lstHistory); historyListLayout.addComponent(btShowMoreHistory); historyListLayout.setExpandRatio(lstHistory, 1.0f); historyListLayout.setExpandRatio(btShowMoreHistory, 0.0f); btHistory = new PopupButton("History"); btHistory.setContent(historyListLayout); btHistory.setDescription("<strong>Show History</strong><br />" + "Either use the short overview (arrow down) or click on the button " + "for the extended view."); Button btShowKeyboard = null; if (virtualKeyboard != null) { btShowKeyboard = new Button(); btShowKeyboard.setWidth("100%"); btShowKeyboard.setDescription("Click to show a virtual keyboard"); btShowKeyboard.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btShowKeyboard.addStyleName(ValoTheme.BUTTON_SMALL); btShowKeyboard.setIcon(new ClassResource(VirtualKeyboardCodeEditor.class, "keyboard.png")); btShowKeyboard.addClickListener(new ShowKeyboardClickListener(virtualKeyboard)); } Button btShowQueryBuilder = new Button("Query<br />Builder"); btShowQueryBuilder.setHtmlContentAllowed(true); btShowQueryBuilder.addStyleName(ValoTheme.BUTTON_SMALL); btShowQueryBuilder.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP); btShowQueryBuilder.setIcon(new ThemeResource("images/tango-icons/32x32/document-properties.png")); btShowQueryBuilder.addClickListener(new ShowQueryBuilderClickListener(ui)); VerticalLayout moreActionsLayout = new VerticalLayout(); moreActionsLayout.setWidth("250px"); btMoreActions = new PopupButton("More"); btMoreActions.setContent(moreActionsLayout); // btShowResultNewTab = new Button("Search (open in new tab)"); // btShowResultNewTab.setWidth("100%"); // btShowResultNewTab.addClickListener(new ShowResultInNewTabClickListener()); // btShowResultNewTab.setDescription("<strong>Show Result and open result in new tab</strong><br />Ctrl + Shift + Enter"); // btShowResultNewTab.setDisableOnClick(true); // btShowResultNewTab.setClickShortcut(KeyCode.ENTER, ModifierKey.CTRL, ModifierKey.SHIFT); // moreActionsLayout.addComponent(btShowResultNewTab); Button btShowExport = new Button("Export", new ShowExportClickListener(ui)); btShowExport.setIcon(FontAwesome.DOWNLOAD); btShowExport.setWidth("100%"); moreActionsLayout.addComponent(btShowExport); Button btShowFrequency = new Button("Frequency Analysis", new ShowFrequencyClickListener(ui)); btShowFrequency.setIcon(FontAwesome.BAR_CHART_O); btShowFrequency.setWidth("100%"); moreActionsLayout.addComponent(btShowFrequency); /* * We use the grid layout for a better rendering efficiency, but this comes * with the cost of some complexity when defining the positions of the * elements in the layout. * * This grid hopefully helps a little bit in understanding the "magic" * numbers better. * * Q: Query text field * QB: Button to toggle query builder // TODO * KEY: Button to show virtual keyboard * SEA: "Search" button * MOR: "More actions" button * HIST: "History" button * STAT: Text field with the real status * PROG: indefinite progress bar (spinning circle) * * \ 0 | 1 | 2 | 3 * --+-----+---+---+---+----- * 0 | Q | Q | Q | QB * --+-----+-----+-----+----- * 1 | Q | Q | Q | KEY * --+-----+-----+-----+----- * 2 | SEA | MOR | HIST| * --+-----+-----+-----+----- * 3 | STAT| STAT| STAT| PROG */ addComponent(txtQuery, 0, 0, 2, 1); addComponent(txtStatus, 0, 3, 2, 3); addComponent(btShowResult, 0, 2); addComponent(btMoreActions, 1, 2); addComponent(btHistory, 2, 2); addComponent(piCount, 3, 3); addComponent(btShowQueryBuilder, 3, 0); if (btShowKeyboard != null) { addComponent(btShowKeyboard, 3, 1); } // alignment setRowExpandRatio(0, 0.0f); setRowExpandRatio(1, 1.0f); setColumnExpandRatio(0, 1.0f); setColumnExpandRatio(1, 0.0f); setColumnExpandRatio(2, 0.0f); setColumnExpandRatio(3, 0.0f); //setComponentAlignment(btShowQueryBuilder, Alignment.BOTTOM_CENTER); }
From source file:at.peppol.webgui.app.MainWindow.java
License:Mozilla Public License
public void showInitialMainContent(UserFolder<?> userFolder) { // ------ START: Main Content ------- final VerticalLayout mainContentLayout = new VerticalLayout(); mainContentLayout.addStyleName("margin"); final VerticalLayout topmain = new VerticalLayout(); topmain.setSpacing(true);//from www.j a v a 2 s .c om topmain.setWidth("100%"); final Label bigPAWGLabel = new Label("PEPPOL Post Award Web GUI"); bigPAWGLabel.setStyleName("huge"); topmain.addComponent(bigPAWGLabel); final Label blahContent = new Label( "This is a mockup of the GUI that is going" + " to be the PAWG. It is created by the Greek" + " and Austrian teams as a fine replacement " + " of the Demo Client"); blahContent.setWidth("80%"); blahContent.addStyleName("big"); //topmain.addComponent (blahContent); //HorizontalLayout itemsPanel = new ShowItemsPanel("Items", um, userFolder); final ShowItemsPanel itemsPanel = new ShowItemsPanel("Items", um, userFolder); this.itemsPanel = itemsPanel; topmain.addComponent(itemsPanel); HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setSpacing(true); topmain.addComponent(buttonsLayout); Button loadButton = new Button("Load invoice"); //topmain.addComponent(loadButton); buttonsLayout.addComponent(loadButton); loadButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { Table table = itemsPanel.getTable(); if (table.getValue() != null) { //InvoiceType inv = (InvoiceType)table.getItem(table.getValue()).getItemProperty("invoice").getValue(); //InvoiceBean invBean = (InvoiceBean)table.getItem(table.getValue()); InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource()) .getItem(table.getValue()).getBean(); //System.out.println("Invoice is: "+invBean); showInvoiceForm(invBean); } } }); Button sendButton = new Button("Send invoice"); buttonsLayout.addComponent(sendButton); sendButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { try { Table table = itemsPanel.getTable(); if (table.getValue() != null) { InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource()) .getItem(table.getValue()).getBean(); String path = invBean.getFolderEntryID(); FileSystemResource s = new FileSystemResource(path); SendInvoice.sendDocument(s); //file is sent. move invoice to outbox um.moveInvoice(invBean, um.getDrafts(), um.getOutbox()); //itemsPanel.getTable().requestRepaint(); itemsPanel.init(um.getDrafts()); } } catch (FileNotFoundException e) { getWindow().showNotification("Could not find invoice file", Notification.TYPE_ERROR_MESSAGE); } catch (Exception e) { getWindow().showNotification("Could not send invoice. AP connection error", Notification.TYPE_ERROR_MESSAGE); e.printStackTrace(); } } }); final Button learnMoreBtn = new Button("Learn More >>"); learnMoreBtn.addStyleName("tall default"); //topmain.addComponent (learnMoreBtn); mainContentLayout.addComponent(topmain); // ------ END: Main Content --------- mainContentLayout.setHeight("100%"); mainContentLayout.setSizeFull(); mainContentLayout.setSpacing(true); mainContentLayout.setWidth("100%"); middleContentLayout.setWidth("100%"); middleContentLayout.setHeight("100%"); middleContentLayout.setMargin(true); // -------- addComponent(middleContentLayout); addComponent(footerLayout); if (mainContentComponent != null) { middleContentLayout.replaceComponent(mainContentComponent, mainContentLayout); } else { middleContentLayout.addComponent(mainContentLayout); } middleContentLayout.setExpandRatio(mainContentLayout, 1); mainContentComponent = mainContentLayout; }
From source file:br.com.anteros.mobileserver.app.form.ConfigurationWindow.java
License:Apache License
public ConfigurationWindow(MobileServerApplication app) { this.app = app; setCaption("Configurao do Servidor"); setModal(true);// w w w .j a va 2 s. c o m configurationForm = new ConfigurationForm(); setClosable(false); addComponent(configurationForm); setResizable(false); setDraggable(false); VerticalLayout layout = (VerticalLayout) this.getContent(); layout.setSpacing(true); layout.setWidth("765px"); layout.setHeight("460px"); configurationForm.getBtnOk().addListener(this); configurationForm.getBtnCancel().addListener(this); loadPreferences(); }
From source file:br.com.anteros.mobileserver.app.form.FieldWindow.java
License:Apache License
public FieldWindow(MobileServerApplication app, FieldSynchronism fieldSynchronism, Synchronism objectOwner) { if ((fieldSynchronism.getId() == null) || (fieldSynchronism.getId() <= 0)) { setCaption("Adicionando"); } else//from www .ja va 2 s.c o m setCaption("Editando"); setModal(true); fieldForm = new FieldForm(app, fieldSynchronism, this, objectOwner, false); addComponent(fieldForm); VerticalLayout layout = (VerticalLayout) this.getContent(); layout.setWidth("700px"); layout.setHeight("270px"); }
From source file:br.com.anteros.mobileserver.app.form.LoginWindow.java
License:Apache License
public LoginWindow(MobileServerApplication app) { this.app = app; setCaption("Login"); setModal(true);//from w ww.j a v a 2 s . c o m loginForm = new UserLoginForm(); setClosable(false); addComponent(loginForm); setResizable(false); VerticalLayout layout = (VerticalLayout) this.getContent(); layout.setSpacing(true); layout.setWidth("400px"); layout.setHeight("150px"); loginForm.getBtnLogin().addListener(this); }
From source file:br.com.anteros.mobileserver.app.form.ParameterWindow.java
License:Apache License
public ParameterWindow(MobileServerApplication app, ParameterSynchronism parameterSynchronism, Synchronism objectOwner) {// w w w. java 2 s . c om if ((parameterSynchronism.getId() == null) || (parameterSynchronism.getId() <= 0)) { setCaption("Adicionando"); } else setCaption("Editando"); setModal(true); setTheme(Reindeer.THEME_NAME); formParameter = new ParameterForm(app, parameterSynchronism, this, objectOwner, false); addComponent(formParameter); VerticalLayout layout = (VerticalLayout) this.getContent(); layout.setWidth("700px"); layout.setHeight("265px"); }
From source file:com.cavisson.gui.dashboard.components.controls.CommonParts.java
License:Apache License
public CommonParts() { setMargin(true);/* ww w.j a va2 s . c om*/ addStyleName("content-common"); Label h1 = new Label("Common UI Elements"); h1.addStyleName("h1"); addComponent(h1); VerticalLayout row = new VerticalLayout(); row.setWidth("100%"); row.setSpacing(true); addComponent(row); row.addComponent(loadingIndicators()); row.addComponent(notifications()); row.addComponent(windows()); row.addComponent(tooltips()); }
From source file:com.cms.utils.CommonUtils.java
public static Panel addOg2Panel(OptionGroup og, String caption, String height) { og.setWidth("100%"); og.setHeight("-1px"); og.setImmediate(true);/*from w ww. j a v a2 s . c o m*/ og.setMultiSelect(true); VerticalLayout layout = new VerticalLayout(); layout.setWidth("100%"); layout.setHeightUndefined(); layout.setImmediate(true); layout.setMargin(true); layout.setSpacing(true); layout.addComponent(og); layout.setComponentAlignment(og, Alignment.MIDDLE_LEFT); Panel panel = new Panel(); if (!DataUtil.isStringNullOrEmpty(caption)) { panel.setCaption(caption); } panel.setWidth("100%"); panel.setImmediate(true); if (!DataUtil.isStringNullOrEmpty(height)) { panel.setHeight(height); } else { panel.setHeight("200px"); } panel.addStyleName(Runo.PANEL_LIGHT); panel.setContent(layout); return panel; }
From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java
private Component buildAvailableUpdateLayout() { Label message = new Label($("UpdateManagerViewImpl.updateAvailable", presenter.getUpdateVersion())); message.addStyleName(ValoTheme.LABEL_BOLD); Button update = new LinkButton($("UpdateManagerViewImpl.updateButton")) { @Override//from w w w. ja va 2s .c o m protected void buttonClick(ClickEvent event) { UI.getCurrent().access(new Thread(UpdateManagerViewImpl.class.getName() + "-updateFromServer") { @Override public void run() { presenter.updateFromServer(); } }); } }; update.setVisible(presenter.isUpdateEnabled()); HorizontalLayout updater = new HorizontalLayout(message, update); updater.setComponentAlignment(message, Alignment.MIDDLE_LEFT); updater.setComponentAlignment(update, Alignment.MIDDLE_LEFT); updater.setSpacing(true); Label changelog = new Label(presenter.getChangelog(), ContentMode.HTML); VerticalLayout layout = new VerticalLayout(updater, changelog); layout.setSpacing(true); layout.setWidth("100%"); return layout; }
From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java
private Component buildLicenseUploadPanel() { Upload upload = new Upload($("UpdateManagerViewImpl.uploadLicenseCaption"), new Receiver() { @Override/*from w w w . j a v a 2 s.c o m*/ public OutputStream receiveUpload(String filename, String mimeType) { return presenter.getLicenseOutputStream(); } }); upload.addSucceededListener(new SucceededListener() { @Override public void uploadSucceeded(SucceededEvent event) { presenter.licenseUploadSucceeded(); } }); upload.setButtonCaption($("UpdateManagerViewImpl.uploadLicense")); Button cancel = new LinkButton($("cancel")) { @Override protected void buttonClick(ClickEvent event) { presenter.licenseUploadCancelled(); } }; VerticalLayout layout = new VerticalLayout(upload, cancel); layout.setWidth("100%"); layout.setSpacing(true); return layout; }