List of usage examples for com.vaadin.ui Alignment MIDDLE_RIGHT
Alignment MIDDLE_RIGHT
To view the source code for com.vaadin.ui Alignment MIDDLE_RIGHT.
Click Source Link
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 ww w . ja va 2 s . com 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);// ww w.ja v a2 s. c om 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);//w w w. java 2 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:at.peppol.webgui.app.MainWindow.java
License:Mozilla Public License
@SuppressWarnings("unused") private void createTopBar() { topBarCSSLayout.setStyleName("toolbar"); topBarCSSLayout.setSizeFull();/*from w ww . j a v a 2 s . com*/ topBarLayout.setMargin(false, true, false, true); topBarLayout.setSizeFull(); topBarLayoutLeft = new HorizontalLayout(); topBarLayoutRight = new HorizontalLayout(); final Label pawgLabel = new Label("PAWG"); pawgLabel.setStyleName("h1"); pawgLabel.setSizeUndefined(); topBarLayoutLeft.addComponent(pawgLabel); final HorizontalLayout segBtns = createTopBarButtons(); topBarLayoutLeft.addComponent(segBtns); // IUser user = (IUser) PawgApp.getInstance().getUser(); final Label loggedInLabel = new Label("Test User"); loggedInLabel.setSizeUndefined(); topBarLayoutRight.addComponent(loggedInLabel); topBarLayoutRight.setComponentAlignment(loggedInLabel, Alignment.MIDDLE_RIGHT); topBarLayoutLeft.setComponentAlignment(segBtns, Alignment.MIDDLE_CENTER); topBarLayoutLeft.setSpacing(true); topBarLayout.addComponent(topBarLayoutLeft); topBarLayout.addComponent(topBarLayoutRight); topBarLayout.setComponentAlignment(topBarLayoutRight, Alignment.MIDDLE_RIGHT); topBarLayout.setExpandRatio(topBarLayoutLeft, 1); topBarLayout.setExpandRatio(topBarLayoutRight, 1); topBarCSSLayout.addComponent(topBarLayout); addComponent(topBarCSSLayout); }
From source file:at.peppol.webgui.app.MainWindow.java
License:Mozilla Public License
private void createMenuBar() { topBarLayout.setMargin(false, false, false, false); topBarLayout.setSizeFull();/*from w w w . j av a2s .co m*/ // topBarLayout.setStyleName("v-menubar"); topBarLayoutLeft = new HorizontalLayout(); topBarLayoutRight = new HorizontalLayout(); // Label pawgLabel = new Label("PAWG",Label.CONTENT_XHTML); // pawgLabel.setStyleName("v-menubar"); // pawgLabel.addStyleName("v-label-big"); // pawgLabel.setSizeFull(); // topBarLayoutLeft.addComponent(pawgLabel); final MenuBar lMenuBar = new MenuBar(); lMenuBar.setHtmlContentAllowed(true); lMenuBar.addItem("<b>PAWG<b>", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { removeComponent(mainContentComponent); showInitialMainContent(um.getDrafts()); } }); final MenuBar.MenuItem docItem = lMenuBar.addItem("Document", null); lMenuBar.addItem("Preferences", null); lMenuBar.addItem("Logout", new MenuBar.Command() { @Override public void menuSelected(MenuItem selectedItem) { PawgApp.getInstance().logout(); PawgApp.getInstance().showLoginWindow(); } }); lMenuBar.addItem("About", null); lMenuBar.setSizeFull(); final MenuBar.MenuItem invItem = docItem.addItem("Invoice", null); final MenuBar.MenuItem orderItem = docItem.addItem("Order", null); invItem.addItem("New ...", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { showInvoiceForm(); //showInvoiceForm (null); } }); invItem.addItem("View ... ", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { showTestForm(); } }); invItem.addItem("Upload ...", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { showInvUploadWindow(); } }); orderItem.addItem("New", null); orderItem.addItem("View", null); orderItem.addItem("Upload ...", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { showOrdUploadWindow(); } }); topBarLayoutLeft.addComponent(lMenuBar); final IUser user = (IUser) PawgApp.getInstance().getUser(); topBarLayoutLeft.setComponentAlignment(lMenuBar, Alignment.MIDDLE_CENTER); topBarLayoutLeft.setSpacing(false); topBarLayoutLeft.setSizeFull(); topBarLayoutRight.setSizeUndefined(); final MenuBar rMenuBar = new MenuBar(); rMenuBar.setHtmlContentAllowed(true); final MenuBar.MenuItem userLabel = rMenuBar.addItem("<b>" + user.getEmailAddress() + "<b>", null); userLabel.addItem("Logout", new MenuBar.Command() { @Override public void menuSelected(final MenuItem selectedItem) { PawgApp.getInstance().logout(); } }); topBarLayoutRight.addComponent(rMenuBar); topBarLayout.addComponent(topBarLayoutLeft); topBarLayout.addComponent(topBarLayoutRight); topBarLayout.setComponentAlignment(topBarLayoutRight, Alignment.MIDDLE_RIGHT); topBarLayout.setExpandRatio(topBarLayoutLeft, 1); // topBarLayout.setExpandRatio(topBarLayoutRight, 1); addComponent(topBarLayout); }
From source file:au.org.scoutmaster.views.ContactView.java
@Override protected AbstractLayout getAdvancedSearchLayout() { final VerticalLayout advancedSearchLayout = new VerticalLayout(); advancedSearchLayout.setSpacing(true); final HorizontalLayout tagSearchLayout = new HorizontalLayout(); this.tagSearchField = new TagField("Search Tags", true); tagSearchLayout.addComponent(this.tagSearchField); tagSearchLayout.setSizeFull();/*from w w w . j av a 2 s . co m*/ advancedSearchLayout.addComponent(tagSearchLayout); final HorizontalLayout stringSearchLayout = new HorizontalLayout(); stringSearchLayout.addComponent(this.searchField); stringSearchLayout.setWidth("100%"); advancedSearchLayout.addComponent(stringSearchLayout); final Button searchButton = new Button("Search"); final Action1<ClickEvent> searchClickAction = new SearchClickAction(); ButtonEventSource.fromActionOf(searchButton).subscribe(searchClickAction); advancedSearchLayout.addComponent(searchButton); advancedSearchLayout.setComponentAlignment(searchButton, Alignment.MIDDLE_RIGHT); return advancedSearchLayout; }
From source file:br.com.anteros.mobileserver.app.form.ActionForm.java
License:Apache License
private void createButtons() { buttons = new HorizontalLayout(); buttons.setSpacing(true);/*w w w . ja va 2s . c o m*/ buttons.setWidth("715px"); btnOk = new Button("Ok", this); btnOk.addStyleName("default"); btnOk.setIcon(new ThemeResource("icons/16/ok.png")); buttons.addComponent(btnOk); buttons.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT); buttons.setExpandRatio(btnOk, 1); btnCancel = new Button("Cancela", this); btnCancel.setIcon(new ThemeResource("icons/16/cancel.png")); buttons.addComponent(btnCancel); buttons.setComponentAlignment(btnCancel, Alignment.MIDDLE_RIGHT); actionForm.getFooter().addComponent(buttons); }
From source file:br.com.anteros.mobileserver.app.form.ApplicationForm.java
License:Apache License
private void createButtons() { buttons = new HorizontalLayout(); buttons.setSpacing(true);/*from w ww. j ava 2 s . c om*/ buttons.setWidth("640px"); btnOk = new Button("Ok", this); btnOk.addStyleName("default"); btnOk.setIcon(new ThemeResource("icons/16/ok.png")); buttons.addComponent(btnOk); buttons.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT); buttons.setExpandRatio(btnOk, 1); btnCancel = new Button("Cancela", this); btnCancel.setIcon(new ThemeResource("icons/16/cancel.png")); buttons.addComponent(btnCancel); buttons.setComponentAlignment(btnCancel, Alignment.MIDDLE_RIGHT); applicationForm.getFooter().addComponent(buttons); }
From source file:br.com.anteros.mobileserver.app.form.ExecuteForm.java
License:Apache License
private void createForm() { if (actionSynchronism.getItems() != null) { Label lblTitle = new Label("Parmetros de execuo Ao " + actionSynchronism.getName() + " (" + actionSynchronism.getId() + ")"); lblTitle.setStyleName("h2 color"); lblTitle.setImmediate(false);/*from w w w .ja v a2 s .c o m*/ addComponent(lblTitle); setComponentAlignment(lblTitle, Alignment.TOP_LEFT); Synchronism synchronism = actionSynchronism.getItems().iterator().next(); executeForm = new Form(); fields.clear(); ParameterSynchronism[] parameters = null; if (synchronism instanceof TableSynchronism) parameters = ((TableSynchronism) synchronism).getParameters(); if (synchronism instanceof ProcedureSynchronism) parameters = ((ProcedureSynchronism) synchronism).getParameters(); for (ParameterSynchronism param : parameters) { if (param.getParameterType().intValue() == ParameterSynchronism.INPUT || param.getParameterType().intValue() == ParameterSynchronism.SUBSTITUITION) { String value = FieldTypes.getFieldTypes().get(param.getParameterDataType().intValue() + ""); if (value != null) { if (FieldTypes.UNKNOW.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("400px"); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.INTEGER.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.VARCHAR.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("400px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.FLOAT.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.NUMERIC.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.DATE.equalsIgnoreCase(value)) { PopupDateField field = new PopupDateField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); field.setResolution(PopupDateField.RESOLUTION_DAY); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.TIME.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } else if (FieldTypes.TIMESTAMP.equalsIgnoreCase(value)) { TextField field = new TextField(); field.setCaption(param.getName()); field.setWidth("150px"); field.setRequired(true); field.setRequiredError("Informe o valor para o campo " + param.getName()); executeForm.addField(param.getName(), field); fields.add(field); } } } } panelForm = new Panel(); panelForm.setHeight("100%"); panelForm.setWidth("100%"); panelForm.setScrollable(true); addComponent(panelForm); executeForm.setImmediate(true); executeForm.setWidth("100%"); panelForm.addComponent(executeForm); executeCommit = new CheckBox("Executar COMMIT no final do processo?"); addComponent(executeCommit); HorizontalLayout buttons = new HorizontalLayout(); buttons.setImmediate(false); buttons.setWidth("600px"); buttons.setHeight("-1px"); buttons.setMargin(false); buttons.setSpacing(true); addComponent(buttons); btnExecute = new Button(); btnExecute.setCaption("Executar"); btnExecute.setIcon(new ThemeResource("icons/16/run.png")); btnExecute.addListener(clickListener); buttons.addComponent(btnExecute); buttons.setComponentAlignment(btnExecute, Alignment.MIDDLE_RIGHT); buttons.setExpandRatio(btnExecute, 1); btnClose = new Button(); btnClose.setCaption("Fechar"); btnClose.setIcon(new ThemeResource("icons/16/doorOut.png")); btnClose.addListener(clickListener); buttons.addComponent(btnClose); buttons.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT); buttons.setMargin(true, false, true, false); addComponent(buttons); pageControl = new TabSheet(); pageControl.setImmediate(true); pageControl.setWidth("100.0%"); pageControl.setHeight("100.0%"); textPanel = new Panel(); textPanel.setImmediate(true); textPanel.setWidth("100%"); textPanel.setHeight("100%"); pageControl.addTab(textPanel, "Resultado", null); addComponent(pageControl); setExpandRatio(pageControl, 1.0f); } }
From source file:br.com.anteros.mobileserver.app.form.FieldForm.java
License:Apache License
private void createButtons() { buttons = new HorizontalLayout(); buttons.setSpacing(true);// w w w. j av a 2s.c o m buttons.setWidth("640px"); btnOk = new Button("Ok", this); btnOk.addStyleName("default"); btnOk.setIcon(new ThemeResource("icons/16/ok.png")); buttons.addComponent(btnOk); buttons.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT); buttons.setExpandRatio(btnOk, 1); btnCancel = new Button("Cancela", this); btnCancel.setIcon(new ThemeResource("icons/16/cancel.png")); buttons.addComponent(btnCancel); buttons.setComponentAlignment(btnCancel, Alignment.MIDDLE_RIGHT); fieldForm.getFooter().addComponent(buttons); }