List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout
public VerticalLayout()
From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java
private Component buildMessagePanel() { VerticalLayout verticalLayout = new VerticalLayout(); UpdateRecoveryImpossibleCause cause = presenter.isUpdateWithRecoveryPossible(); if (cause != null) { verticalLayout.addComponent(new Label( "<p style=\"color:red\">" + $("UpdateManagerViewImpl." + cause) + "</p>", ContentMode.HTML)); } else {/* ww w . j av a2s . co m*/ UpdateNotRecommendedReason updateNotRecommendedReason = presenter.getUpdateNotRecommendedReason(); if (updateNotRecommendedReason != null) { verticalLayout.addComponent(new Label("<p style=\"color:red\">" + $("UpdateManagerViewImpl." + updateNotRecommendedReason) + "</p>", ContentMode.HTML)); } } final String exceptionDuringLastUpdate = presenter.getExceptionDuringLastUpdate(); if (StringUtils.isNotBlank(exceptionDuringLastUpdate)) { verticalLayout.addComponent(new Label( "<p style=\"color:red\">" + $("UpdateManagerViewImpl.exceptionCausedByLastVersion") + "</p>", ContentMode.HTML)); WindowButton windowButton = new WindowButton($("details"), $("details"), WindowConfiguration.modalDialog("90%", "90%")) { @Override protected Component buildWindowContent() { TextArea textArea = new TextArea(); textArea.setSizeFull(); textArea.setValue(exceptionDuringLastUpdate); return textArea; } }; windowButton.addStyleName(ValoTheme.BUTTON_LINK); verticalLayout.addComponent(windowButton); verticalLayout.addComponent(new Label("<p style=\"color:red\">" + "" + "</p>", ContentMode.HTML)); } return verticalLayout; }
From source file:com.cxplonka.feature.ui.vaadin.VaadinUI.java
private void initLayout() { final VerticalLayout root = new VerticalLayout(); root.setSizeFull();/*from w w w . ja v a2 s. co m*/ root.setMargin(true); root.setSpacing(true); setContent(root); final CssLayout navigationBar = new CssLayout(); navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP); navigationBar.addComponent(createNavigationButton("Default View", DefaultView.VIEW_NAME)); navigationBar.addComponent(createNavigationButton("Data View", DataTableView.VIEW_NAME)); root.addComponent(navigationBar); final Panel viewContainer = new Panel(); viewContainer.setSizeFull(); root.addComponent(viewContainer); root.setExpandRatio(viewContainer, 1.0f); Navigator navigator = new Navigator(this, viewContainer); navigator.addProvider(viewProvider); }
From source file:com.demo.tutorial.agenda.ui.HelpWindow.java
public HelpWindow() { setCaption("Address Book Help"); VerticalLayout subContent = new VerticalLayout(); subContent.addComponent(new Label(HELP_HTML_SNIPPET)); subContent.setMargin(true);//from w ww . j a v a2 s .c o m setContent(subContent); //DESHABILITAR LA X CERRAR setClosable(true); //false //DESHABILITAR EL AGRANDAR VENTANA setResizable(false); }
From source file:com.demo.tutorial.agenda.ui.SharingOptions.java
public SharingOptions() { setModal(true);/*from w w w .j a va 2 s . c o m*/ setWidth("50%"); center(); setCaption("Sharing Options"); VerticalLayout subContent = new VerticalLayout(); subContent.addComponent(new Label(SHARING_HTML_SNNIPET)); subContent.addComponent(new CheckBox("Gmail")); subContent.addComponent(new CheckBox(".Mac")); Button close = new Button("Ok"); close.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { close(); } }); subContent.addComponent(close); setContent(subContent); }
From source file:com.digitallabs.demos.Vaadin6BootstrapThemeDemo.java
License:Apache License
private void forms(ComponentContainer container) { VerticalLayout form = new VerticalLayout(); form.addStyleName(Bootstrap.Forms.FORM.styleName()); form.setSpacing(true);// w ww . ja v a2s .c o m form.setCaption("Legend"); TextField email = new TextField("Email address"); email.setInputPrompt("Enter email"); form.addComponent(email); PasswordField password = new PasswordField("Password"); password.setInputPrompt("Password"); form.addComponent(password); Upload upload = new Upload("File input", null); form.addComponent(upload); Label help = new Label("Example block-level help text here."); help.addStyleName("help-block"); form.addComponent(help); CheckBox check = new CheckBox("Check me out"); form.addComponent(check); Button submit = new Button("Submit"); submit.addStyleName(Bootstrap.Buttons.DEFAULT.styleName()); form.addComponent(submit); container.addComponent(form); }
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())); }/*from w ww .jav 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.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())); }/* w w w . j a v a 2 s. 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 w w w. j av a 2s .com 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.InsertImageUI.java
public final void init() { setWidth("100%"); addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING); layout = new VerticalLayout(); layout.setSizeFull();/*from w w w .ja v a2s . c o m*/ layout.setSpacing(true); this.addComponent(layout); btnAdd = new Button(); btnAdd.setIcon(FontAwesome.PLUS_CIRCLE); btnAdd.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnAdd.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnAdd.setWidth("25px"); btnAdd.setHeight("25px"); this.addComponent(btnAdd); }
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 w w w. j a v a 2 s .com 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); }