List of usage examples for com.vaadin.ui Alignment BOTTOM_RIGHT
Alignment BOTTOM_RIGHT
To view the source code for com.vaadin.ui Alignment BOTTOM_RIGHT.
Click Source Link
From source file:annis.gui.flatquerybuilder.SearchBox.java
License:Apache License
public SearchBox(final String ebene, final FlatQueryBuilder sq, final VerticalNode vn, boolean isRegex, boolean negativeSearch) { this.vn = vn; this.ebene = ebene; this.sq = sq; this.vfs = new ArrayList<>(); vnframe = new VerticalLayout(); vnframe.setSpacing(true);//from w ww.j a v a2s .co m vnframe.setImmediate(true); this.sb = new VerticalLayout(); //maybe other name? sb is "reserved" by SearchBox sb.setImmediate(true); sb.setSpacing(false); //used to be true lbl = new Label(ebene); HorizontalLayout sbtoolbar = new HorizontalLayout(); sbtoolbar.setSpacing(false); // searchbox tickbox for regex reBox = new CheckBox(CAPTION_REBOX); reBox.setImmediate(true); sbtoolbar.addComponent(reBox); reBox.addValueChangeListener(new ValueChangeListener() { // TODO make this into a nice subroutine @Override public void valueChange(ValueChangeEvent event) { if (reBox.getValue()) { for (ValueField vf : vfs) { String value = vf.getValue(); vf.setValueMode(ValueField.ValueMode.REGEX); if (value != null) { vf.setValue(sq.escapeRegexCharacters(value)); } } } else { for (ValueField vf : vfs) { String value = vf.getValue(); vf.setValueMode(ValueField.ValueMode.NORMAL); if (value != null) { vf.setValue(sq.unescape(value)); } } } } }); reBox.setValue(isRegex); reBox.setEnabled(true); reBoxSingleValue = isRegex; // searchbox tickbox for negative search negSearchBox = new CheckBox(NEGATIVE_SEARCH_LABEL); negSearchBox.setImmediate(true); negSearchBox.setValue(negativeSearch); sbtoolbar.addComponent(negSearchBox); // close the searchbox btClose = new Button(BUTTON_CLOSE_LABEL, (Button.ClickListener) this); btClose.setStyleName(ValoTheme.BUTTON_SMALL); HorizontalLayout titleBar = new HorizontalLayout(); titleBar.setWidth(vnframe.getWidth(), vnframe.getWidthUnits()); titleBar.addComponent(lbl); titleBar.setComponentAlignment(lbl, Alignment.BOTTOM_LEFT); titleBar.addComponent(btClose); titleBar.setComponentAlignment(btClose, Alignment.TOP_RIGHT); btAdd = new Button(LABEL_BUTTON_ADD); btAdd.addClickListener((Button.ClickListener) this); btAdd.setStyleName(ValoTheme.BUTTON_SMALL); vnframe.addComponent(titleBar); vnframe.addComponent(sb); vnframe.addComponent(btAdd); vnframe.setComponentAlignment(btAdd, Alignment.BOTTOM_RIGHT); vnframe.addComponent(sbtoolbar); ValueField vf = new ValueField(sq, this, ebene); vf.setProtected(true); vfs.add(vf); sb.addComponent(vf); setContent(vnframe); }
From source file:annis.gui.flatquerybuilder.ValueField.java
License:Apache License
public ValueField(FlatQueryBuilder sq, SearchBox sb, String level) { /*INIT VALUES*/ this.sq = sq; this.sb = sb; this.level = level; vm = (sb.isRegEx()) ? ValueMode.REGEX : ValueMode.NORMAL; values = new ConcurrentSkipListMap<>(); for (String v : sq.getAvailableAnnotationLevels(level)) { values.put(v, sq.escapeRegexCharacters(v)); }/*from w w w. j a v a 2 s . co m*/ /*SENSITIVE COMBOBOX*/ scb = new SensitiveComboBox(); scb.setImmediate(true); scb.setNewItemsAllowed(true); scb.setTextInputAllowed(true); scb.setFilteringMode(FilteringMode.OFF); scb.addListener((TextChangeListener) this); scb.setItemCaptionMode(ItemCaptionMode.ID); buildValues(vm); scb.addStyleName(SCB_STYLE_NAME); scb.setWidth(SCB_WIDTH); /*BUTTON*/ bt = new Button(BUTTON_LABEL_REMOVE); bt.addClickListener((Button.ClickListener) this); bt.setStyleName(ChameleonTheme.BUTTON_SMALL); /*HORIZONTAL LAYOUT*/ frame = new HorizontalLayout(); frame.setSpacing(true);//used to be true frame.setCaption(level); /*VISUALIZE*/ frame.addComponent(scb); frame.addComponent(bt); frame.setComponentAlignment(bt, Alignment.BOTTOM_RIGHT); setContent(frame); }
From source file:annis.gui.flatquerybuilder.VerticalNode.java
License:Apache License
public VerticalNode(String ebene, String value, FlatQueryBuilder sq, boolean isRegex, boolean negativeSearch) { this.sq = sq; v = new VerticalLayout(); v.setSpacing(true);//from ww w .j av a 2 s .c o m vframe = new VerticalLayout(); vframe.setSpacing(true); sboxes = new ArrayList<>(); btClose = new Button(SearchBox.BUTTON_CLOSE_LABEL, (Button.ClickListener) this); btClose.setStyleName(ChameleonTheme.BUTTON_SMALL); SearchBox sb = new SearchBox(ebene, sq, this, isRegex, negativeSearch); if (value != null) { sb.setValue(value); } sboxes.add(sb); annonames = sq.getAvailableAnnotationNames(); am = new AddMenu(sq, this, ebene); vframe.addComponent(btClose); vframe.setComponentAlignment(btClose, Alignment.TOP_RIGHT); v.addComponent(sb); vframe.addComponent(v); vframe.addComponent(am); vframe.setComponentAlignment(am, Alignment.BOTTOM_RIGHT); setWidth(WIDTH); setContent(vframe); }
From source file:at.peppol.webgui.app.components.InvoiceLineWindow.java
License:Mozilla Public License
public InvoiceLineWindow(final TabInvoiceLine parent) { this.parent = parent; invln = new InvoiceLineAdapter(); // line = new Line(); // BeanItem<InvoiceLineAdapter> invoiceLine = new BeanItem<InvoiceLineAdapter>(invln); // parent.setItemDataSource(invoiceLine); // BeanItem<Line> invoiceLine = new BeanItem<Line>(line); // parent.setItemDataSource(invoiceLine); subwindow = new Window("Invoice Line"); subwindow.setModal(true);//from w w w. j a va 2s . c o m VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); Button btnClose = new Button("Close", new Button.ClickListener() { public void buttonClick(ClickEvent event) { (subwindow.getParent()).removeWindow(subwindow); } }); Button btnSave = new Button("Save", new Button.ClickListener() { public void buttonClick(ClickEvent event) { //update GUI table !! ///parent.getTable().addInvoiceLine (invln); //update actual invoice line item ///parent.items.add (invln); //close popup (subwindow.getParent()).removeWindow(subwindow); } }); try { layout.addComponent(createInvoiceLineForm()); } catch (Exception e) { e.printStackTrace(); } layout.addComponent(btnSave); layout.addComponent(btnClose); layout.setComponentAlignment(btnClose, Alignment.BOTTOM_RIGHT); }
From source file:com.aaron.mbpet.views.users.UserEditor.java
License:Apache License
public UserEditor(Item personItem, String lableText, boolean mode) { this.editMode = mode; // this.setModal(true); center();//w w w. ja v a2 s . co m setResizable(true); setClosable(true); setModal(true); // setSizeUndefined(); setWidth(25, Unit.EM); this.currsessionuser = ((MbpetUI) UI.getCurrent()).getSessionUser(); VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); this.personItem = personItem; editorForm = new Form(); editorForm.setFormFieldFactory(this); editorForm.setBuffered(true); editorForm.setImmediate(true); editorForm.setItemDataSource(personItem, Arrays.asList("firstname", "lastname", "email", "username", "password", "organization")); //buttons saveButton = new Button("Save", this); saveButton.setClickShortcut(KeyCode.ENTER); cancelButton = new Button("Cancel", this); saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY); HorizontalLayout buttons = new HorizontalLayout(); buttons.setWidth("100%"); buttons.addComponents(saveButton, cancelButton); buttons.setComponentAlignment(saveButton, Alignment.BOTTOM_LEFT); buttons.setComponentAlignment(cancelButton, Alignment.BOTTOM_RIGHT); // editorForm.getFooter().addComponent(buttons); // editorForm.getFooter().addComponent(cancelButton); layout.addComponent(new Label("<h3>" + lableText + "</h3>", ContentMode.HTML)); layout.addComponent(editorForm); layout.setComponentAlignment(editorForm, Alignment.MIDDLE_CENTER); layout.addComponent(buttons); setContent(layout); //editorForm setCaption(buildCaption()); }
From source file:com.dungnv.streetfood.ui.ArticleItemUI.java
private void init() { this.addStyleName("item-interator"); this.setSpacing(true); this.setWidth("100%"); CssLayout horizontal = new CssLayout(); horizontal.setStyleName("padding-5"); horizontal.setWidth("100%"); Responsive.makeResponsive(horizontal); this.addComponent(horizontal); Image imag = new Image(); if (!StringUtils.isNullOrEmpty(item.getImageUrl())) { imag.setSource(new ExternalResource(item.getImageUrl())); }// ww w .ja v a2 s .c o m horizontal.addComponent(imag); VerticalLayout vlInfo = new VerticalLayout(); vlInfo.setStyleName("padding-5"); vlInfo.setWidth("70%"); horizontal.addComponent(vlInfo); lbTitle = new Label(item.getTitle()); lbTitle.addStyleName("lb-title"); vlInfo.addComponent(lbTitle); lbIntroduce = new Label(item.getShortContent()); lbIntroduce.setStyleName("lb-description"); vlInfo.addComponent(lbIntroduce); HorizontalLayout htInfo = new HorizontalLayout(); vlInfo.addComponent(htInfo); lbInfo = new Label(); lbInfo.setCaptionAsHtml(true); htInfo.addComponent(lbInfo); HorizontalLayout htToolBar = new HorizontalLayout(); htToolBar.setStyleName("lb-toolbar"); horizontal.addComponent(htToolBar); btnLink = new Button(); btnLink.setIcon(FontAwesome.LINK); btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLink.setWidth("25px"); btnLink.setHeight("25px"); htToolBar.addComponent(btnLink); htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT); btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnEdit.setWidth("25px"); btnEdit.setHeight("25px"); htToolBar.addComponent(btnEdit); htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT); btnDelete = new Button(); btnDelete.setIcon(FontAwesome.TIMES); btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnDelete.setWidth("25px"); btnDelete.setHeight("25px"); htToolBar.addComponent(btnDelete); htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT); }
From source file:com.dungnv.streetfood.ui.CategoryItemUI.java
private void init() { this.addStyleName("item-interator"); this.setSpacing(true); this.setWidth("100%"); CssLayout horizontal = new CssLayout(); horizontal.setStyleName("padding-5"); horizontal.setWidth("100%"); Responsive.makeResponsive(horizontal); this.addComponent(horizontal); Image imag = new Image(); if (!StringUtils.isNullOrEmpty(item.getImageUrl())) { imag.setSource(new ExternalResource(item.getImageUrl())); }/*from w w w . java 2s .co m*/ horizontal.addComponent(imag); VerticalLayout vlInfo = new VerticalLayout(); vlInfo.setStyleName("padding-5"); vlInfo.setWidth("70%"); horizontal.addComponent(vlInfo); lbTitle = new Label(item.getName()); lbTitle.addStyleName("lb-title"); if ("1".equals(item.getCategoryStatus())) { lbTitle.addStyleName("lb-status-active"); } else { lbTitle.addStyleName("lb-status-inActive"); } vlInfo.addComponent(lbTitle); lbDesc = new Label(item.getDescription()); lbDesc.setStyleName("lb-description"); vlInfo.addComponent(lbDesc); HorizontalLayout htInfo = new HorizontalLayout(); vlInfo.addComponent(htInfo); lbInfo = new Label(); lbInfo.setCaptionAsHtml(true); htInfo.addComponent(lbInfo); HorizontalLayout htToolBar = new HorizontalLayout(); htToolBar.setStyleName("lb-toolbar"); horizontal.addComponent(htToolBar); btnLock = new Button(); if ("1".equals(item.getCategoryStatus())) { btnLock.setIcon(FontAwesome.LOCK); } else { btnLock.setIcon(FontAwesome.UNLOCK); } btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLock.setWidth("25px"); btnLock.setHeight("25px"); htToolBar.addComponent(btnLock); htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT); btnLink = new Button(); btnLink.setIcon(FontAwesome.LINK); btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLink.setWidth("25px"); btnLink.setHeight("25px"); htToolBar.addComponent(btnLink); htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT); btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnEdit.setWidth("25px"); btnEdit.setHeight("25px"); htToolBar.addComponent(btnEdit); htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT); btnDelete = new Button(); btnDelete.setIcon(FontAwesome.TIMES); btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnDelete.setWidth("25px"); btnDelete.setHeight("25px"); htToolBar.addComponent(btnDelete); htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT); }
From source file:com.dungnv.streetfood.ui.DishItemUI.java
private void init() { this.addStyleName("item-interator"); this.setSpacing(true); this.setWidth("100%"); CssLayout horizontal = new CssLayout(); horizontal.setStyleName("padding-5"); horizontal.setWidth("100%"); Responsive.makeResponsive(horizontal); this.addComponent(horizontal); Image imag = new Image(); if (!StringUtils.isNullOrEmpty(item.getImageUrl())) { imag.setSource(new ExternalResource(item.getImageUrl())); }/*from ww w . j av a 2 s . c o m*/ horizontal.addComponent(imag); VerticalLayout vlInfo = new VerticalLayout(); vlInfo.setStyleName("padding-5"); vlInfo.setWidth("70%"); horizontal.addComponent(vlInfo); lbTitle = new Label(item.getName()); lbTitle.addStyleName("lb-title"); vlInfo.addComponent(lbTitle); lbDesc = new Label(item.getShortDescription()); lbDesc.setStyleName("lb-description"); vlInfo.addComponent(lbDesc); HorizontalLayout htInfo = new HorizontalLayout(); vlInfo.addComponent(htInfo); lbInfo = new Label(); lbInfo.setCaptionAsHtml(true); htInfo.addComponent(lbInfo); HorizontalLayout htToolBar = new HorizontalLayout(); htToolBar.setStyleName("lb-toolbar"); horizontal.addComponent(htToolBar); btnLock = new Button(); if ("1".equals(item.getDishStatus())) { btnLock.setIcon(FontAwesome.LOCK); } else { btnLock.setIcon(FontAwesome.UNLOCK); } btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLock.setWidth("25px"); btnLock.setHeight("25px"); htToolBar.addComponent(btnLock); htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT); btnLink = new Button(); btnLink.setIcon(FontAwesome.LINK); btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLink.setWidth("25px"); btnLink.setHeight("25px"); htToolBar.addComponent(btnLink); htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT); btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnEdit.setWidth("25px"); btnEdit.setHeight("25px"); htToolBar.addComponent(btnEdit); htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT); btnDelete = new Button(); btnDelete.setIcon(FontAwesome.TIMES); btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnDelete.setWidth("25px"); btnDelete.setHeight("25px"); htToolBar.addComponent(btnDelete); htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT); }
From source file:com.dungnv.streetfood.ui.RestaurantItemUI.java
private void init() { this.addStyleName("item-interator"); this.setSpacing(true); this.setWidth("100%"); CssLayout horizontal = new CssLayout(); horizontal.setStyleName("padding-5"); horizontal.setWidth("100%"); Responsive.makeResponsive(horizontal); this.addComponent(horizontal); Image imag = new Image(); if (!StringUtils.isNullOrEmpty(item.getImageUrl())) { imag.setSource(new ExternalResource(item.getImageUrl())); }/*from www . j a v a 2 s . c o m*/ horizontal.addComponent(imag); VerticalLayout vlInfo = new VerticalLayout(); vlInfo.setStyleName("padding-5"); vlInfo.setWidth("70%"); horizontal.addComponent(vlInfo); lbTitle = new Label(item.getName()); lbTitle.addStyleName("lb-title"); vlInfo.addComponent(lbTitle); lbIntroduce = new Label(item.getAddress()); lbIntroduce.setStyleName("lb-description"); vlInfo.addComponent(lbIntroduce); HorizontalLayout htInfo = new HorizontalLayout(); vlInfo.addComponent(htInfo); lbInfo = new Label(); lbInfo.setCaptionAsHtml(true); htInfo.addComponent(lbInfo); HorizontalLayout htToolBar = new HorizontalLayout(); htToolBar.setStyleName("lb-toolbar"); horizontal.addComponent(htToolBar); btnLock = new Button(); if ("1".equals(item.getRestaurantStatus())) { btnLock.setIcon(FontAwesome.LOCK); } else { btnLock.setIcon(FontAwesome.UNLOCK); } btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLock.setWidth("25px"); btnLock.setHeight("25px"); htToolBar.addComponent(btnLock); htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT); btnLink = new Button(); btnLink.setIcon(FontAwesome.LINK); btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnLink.setWidth("25px"); btnLink.setHeight("25px"); htToolBar.addComponent(btnLink); htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT); btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnEdit.setWidth("25px"); btnEdit.setHeight("25px"); htToolBar.addComponent(btnEdit); htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT); btnDelete = new Button(); btnDelete.setIcon(FontAwesome.TIMES); btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnDelete.setWidth("25px"); btnDelete.setHeight("25px"); htToolBar.addComponent(btnDelete); htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT); }
From source file:com.dungnv.streetfood.ui.SlideShowItemUI.java
private void init() { this.addStyleName("item-interator"); this.setSpacing(true); this.setWidth("100%"); CssLayout horizontal = new CssLayout(); horizontal.setStyleName("padding-5"); horizontal.setWidth("100%"); Responsive.makeResponsive(horizontal); this.addComponent(horizontal); Image imag = new Image(); if (!StringUtils.isNullOrEmpty(item.getImageUrl())) { imag.setSource(new ExternalResource(item.getImageUrl())); }/*from www . ja v a 2s . c o m*/ horizontal.addComponent(imag); VerticalLayout vlInfo = new VerticalLayout(); vlInfo.setStyleName("padding-5"); vlInfo.setWidth("70%"); horizontal.addComponent(vlInfo); lbTitle = new Label(item.getName()); lbTitle.addStyleName("lb-title"); vlInfo.addComponent(lbTitle); lbIntroduce = new Label(item.getDescription()); lbIntroduce.setStyleName("lb-description"); vlInfo.addComponent(lbIntroduce); HorizontalLayout htInfo = new HorizontalLayout(); vlInfo.addComponent(htInfo); lbInfo = new Label(); lbInfo.setCaptionAsHtml(true); htInfo.addComponent(lbInfo); HorizontalLayout htToolBar = new HorizontalLayout(); htToolBar.setStyleName("lb-toolbar"); horizontal.addComponent(htToolBar); btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnEdit.setWidth("25px"); btnEdit.setHeight("25px"); htToolBar.addComponent(btnEdit); htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT); btnDelete = new Button(); btnDelete.setIcon(FontAwesome.TIMES); btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnDelete.setWidth("25px"); btnDelete.setHeight("25px"); htToolBar.addComponent(btnDelete); htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT); }