List of usage examples for com.vaadin.ui HorizontalLayout HorizontalLayout
public HorizontalLayout()
From source file:com.compomics.sigpep.webapp.MyVaadinApplication.java
License:Apache License
@Override public void init() { iApplication = this; iSigPepSessionFactory = ApplicationLocator.getInstance().getApplication().getSigPepSessionFactory(); //add theme// w w w . j a va 2 s . co m setTheme("sigpep"); //add main window Window lMainwindow = new Window("Sigpep Application"); setMainWindow(lMainwindow); lMainwindow.addStyleName("v-app-my"); //add notification component iNotifique = new Notifique(Boolean.FALSE); CustomOverlay lCustomOverlay = new CustomOverlay(iNotifique, getMainWindow()); getMainWindow().addComponent(lCustomOverlay); //add form help iFormHelp = new FormHelp(); iFormHelp.setFollowFocus(Boolean.TRUE); this.getMainWindow().getContent().addComponent(iFormHelp); //add panels iCenterLeft = new Panel(); iCenterLeft.addStyleName(Reindeer.PANEL_LIGHT); iCenterLeft.setHeight("400px"); iCenterLeft.setWidth("100%"); iCenterRight = new Panel(); iCenterRight.addStyleName(Reindeer.PANEL_LIGHT); iCenterRight.setHeight("400px"); iCenterRight.setWidth("75%"); //add form tabs iFormTabSheet = new FormTabSheet(this); iCenterLeft.addComponent(iFormTabSheet); iBottomLayoutResults = new VerticalLayout(); if (PropertiesConfigurationHolder.showTestDemoFolder()) { Button lButton = new Button("load test data"); lButton.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { new BackgroundThread().run(); } }); iBottomLayoutResults.addComponent(lButton); } // Add the selector component iSelectionComponent = new TransitionSelectionComponent(MyVaadinApplication.this); iCenterRight.addComponent(iSelectionComponent); iHeaderLayout = new HorizontalLayout(); iHeaderLayout.setSizeFull(); iHeaderLayout.setHeight("100px"); iHeaderLayout.addStyleName("v-header"); VerticalLayout lVerticalLayout = new VerticalLayout(); GridLayout lGridLayout = new GridLayout(2, 1); lGridLayout.setSpacing(true); lGridLayout.setSizeFull(); lGridLayout.addComponent(iCenterLeft, 0, 0); lGridLayout.setComponentAlignment(iCenterLeft, Alignment.TOP_LEFT); lGridLayout.addComponent(iCenterRight, 1, 0); lGridLayout.setComponentAlignment(iCenterRight, Alignment.TOP_CENTER); lVerticalLayout.addComponent(iHeaderLayout); lVerticalLayout.addComponent(lGridLayout); lVerticalLayout.addComponent(iBottomLayoutResults); lVerticalLayout.setComponentAlignment(iHeaderLayout, Alignment.MIDDLE_CENTER); lVerticalLayout.setComponentAlignment(lGridLayout, Alignment.MIDDLE_CENTER); lVerticalLayout.setComponentAlignment(iBottomLayoutResults, Alignment.MIDDLE_CENTER); lMainwindow.addComponent(lVerticalLayout); lMainwindow.addComponent(pusher); // Create a tracker for vaadin.com domain. String lDomainName = PropertiesConfigurationHolder.getInstance().getString("analytics.domain"); String lPageId = PropertiesConfigurationHolder.getInstance().getString("analytics.page"); GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-26252212-1", lDomainName); lMainwindow.addComponent(tracker); tracker.trackPageview(lPageId); /** * Sets an UncaughtExceptionHandler and executes the thread by the ExecutorsService */ Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler()); parseSessionId(); }
From source file:com.constellio.app.ui.pages.base.MainLayoutImpl.java
public MainLayoutImpl(AppLayerFactory appLayerFactory) { this.presenter = new MainLayoutPresenter(this); mainMenuContentFooterLayout = new HorizontalLayout(); mainMenuContentFooterLayout.setSizeFull(); mainMenuContentFooterLayout.addStyleName("main-menu-content-footer"); contentViewWrapper = new Panel(); Navigator navigator = new Navigator(UI.getCurrent(), contentViewWrapper); NavigatorConfigurationService navigatorConfigurationService = appLayerFactory .getNavigatorConfigurationService(); navigatorConfigurationService.configure(navigator); UI.getCurrent().setNavigator(navigator); contentFooterWrapperLayout = new CssLayout(); contentFooterWrapperLayout.setId("content-footer-wrapper"); contentFooterLayout = new VerticalLayout(); contentFooterLayout.addStyleName("content-footer"); header = buildHeader();//from ww w. j av a 2s. c om header.setSizeUndefined(); mainMenu = buildMainMenu(); userDocumentsWindow = new UserDocumentsWindow(); dragAndDropWrapper = new DragAndDropWrapper(mainMenuContentFooterLayout); dragAndDropWrapper.setSizeFull(); dragAndDropWrapper.setDropHandler(userDocumentsWindow); navigator.addViewChangeListener(new ViewChangeListener() { @Override public boolean beforeViewChange(ViewChangeEvent event) { return true; } @Override public void afterViewChange(ViewChangeEvent event) { View newView = event.getNewView(); if (newView instanceof NoDragAndDrop) { dragAndDropWrapper.setDropHandler(null); } else if (newView instanceof DropHandler) { dragAndDropWrapper.setDropHandler((DropHandler) newView); } else { List<DropHandler> viewDropHandlers = ComponentTreeUtils.getChildren((Component) newView, DropHandler.class); if (viewDropHandlers.size() > 1) { dragAndDropWrapper.setDropHandler(null); } else if (viewDropHandlers.size() == 1) { dragAndDropWrapper.setDropHandler(viewDropHandlers.get(0)); } else if (dragAndDropWrapper.getDropHandler() != userDocumentsWindow) { dragAndDropWrapper.setDropHandler(userDocumentsWindow); } } // SerializationUtils.clone(event.getOldView()); // SerializationUtils.clone(newView); } }); addComponent(header); addComponent(dragAndDropWrapper); setExpandRatio(dragAndDropWrapper, 1); mainMenuContentFooterLayout.addComponent(mainMenu); mainMenuContentFooterLayout.addComponent(contentFooterWrapperLayout); mainMenuContentFooterLayout.setExpandRatio(contentFooterWrapperLayout, 1); contentFooterWrapperLayout.addComponent(contentFooterLayout); contentFooterLayout.addComponent(contentViewWrapper); Component message = buildMessage(); if (message != null) { message.addStyleName("message"); contentFooterLayout.addComponent(message); } contentFooterLayout.setExpandRatio(contentViewWrapper, 1); Component footer = buildFooter(); if (footer != null) { contentFooterLayout.addComponent(footer); } Component license = buildLicense(); if (license != null) { license.addStyleName("license"); } PagesComponentsExtensionParams params = new PagesComponentsExtensionParams(header, mainMenu, contentFooterLayout, this, contentViewWrapper, contentFooterWrapperLayout, presenter.getUser()); appLayerFactory.getExtensions().getSystemWideExtensions().decorateView(params); String collection = ConstellioUI.getCurrentSessionContext().getCurrentCollection(); if (collection != null) { appLayerFactory.getExtensions().forCollection(collection).decorateView(params); } buildInitJavascript(); }
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())); }/*w w w . ja va 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.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())); }// www . j a 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.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.CommonSearchPagedUI.java
private final void init() { setWidth("100%"); setStyleName("item-search-box"); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true);/*from w w w. ja va2 s . c om*/ this.addComponent(layout); FormLayout form = new FormLayout(); // form.setWidth("100%"); form.setMargin(false); layout.addComponent(form); layout.setComponentAlignment(form, Alignment.MIDDLE_CENTER); cbRecordPerPage = new ComboBox(); cbRecordPerPage.setWidth("65px"); cbRecordPerPage.setStyleName(ValoTheme.COMBOBOX_TINY); cbRecordPerPage.setCaption(BundleUtils.getLanguage("lbl.recordsPerPage")); cbRecordPerPage.setTextInputAllowed(false); cbRecordPerPage.addItem(10); cbRecordPerPage.addItem(20); cbRecordPerPage.addItem(30); cbRecordPerPage.addItem(50); cbRecordPerPage.addItem(100); cbRecordPerPage.addItem(200); cbRecordPerPage.select(10); form.addComponent(cbRecordPerPage); cbRecordPerPage.setNullSelectionAllowed(false); btnFastBackward = new Button(); btnFastBackward.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnFastBackward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnFastBackward.setIcon(FontAwesome.FAST_BACKWARD); layout.addComponent(btnFastBackward); layout.setComponentAlignment(btnFastBackward, Alignment.MIDDLE_CENTER); btnBackward = new Button(); btnBackward.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnBackward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnBackward.setIcon(FontAwesome.BACKWARD); layout.addComponent(btnBackward); layout.setComponentAlignment(btnBackward, Alignment.MIDDLE_CENTER); cbPaged = new ComboBox(); cbPaged.setTextInputAllowed(false); for (int i = 1; i <= pageCount; i++) { cbPaged.addItem(i); } cbPaged.setNullSelectionAllowed(false); cbPaged.select(1); cbPaged.addStyleName(ValoTheme.COMBOBOX_TINY); cbPaged.setWidth("60px"); layout.addComponent(cbPaged); layout.setComponentAlignment(cbPaged, Alignment.MIDDLE_CENTER); btnFoward = new Button(); btnFoward.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnFoward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnFoward.setIcon(FontAwesome.FORWARD); layout.addComponent(btnFoward); layout.setComponentAlignment(btnFoward, Alignment.MIDDLE_CENTER); btnFastFoward = new Button(); btnFastFoward.addStyleName(ValoTheme.BUTTON_ICON_ONLY); btnFastFoward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); btnFastFoward.setIcon(FontAwesome.FAST_FORWARD); layout.addComponent(btnFastFoward); layout.setComponentAlignment(btnFastFoward, Alignment.MIDDLE_CENTER); enableComponent(); }
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())); }/*ww w . j a va 2 s . c om*/ 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 w w w . j a va 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 a2 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"); 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); }
From source file:com.dungnv.streetfood.ui.TwinColumnUI.java
public final void init() { setMargin(true);/* w ww. j a v a2 s . c o m*/ setSpacing(true); setWidth(100f, Unit.PERCENTAGE); HorizontalLayout hLayout = new HorizontalLayout(); hLayout.setSpacing(true); hLayout.setWidth(100f, Unit.PERCENTAGE); addComponent(hLayout); msLeft = new MultiSelectUI(searchField); msLeft.setWidth(100.0f, Unit.PERCENTAGE); hLayout.addComponent(msLeft); hLayout.setExpandRatio(msLeft, .45f); VerticalLayout vButtonLayout = new VerticalLayout(); vButtonLayout.setSpacing(true); hLayout.addComponent(vButtonLayout); hLayout.setExpandRatio(vButtonLayout, .1f); hLayout.setComponentAlignment(vButtonLayout, Alignment.BOTTOM_CENTER); btnLeftAll = new Button(); btnLeftAll.setWidth(100f, Unit.PERCENTAGE); btnLeftAll.setIcon(FontAwesome.ANGLE_DOUBLE_LEFT); vButtonLayout.addComponent(btnLeftAll); btnLeft = new Button(); btnLeft.setWidth(100f, Unit.PERCENTAGE); btnLeft.setIcon(FontAwesome.ANGLE_LEFT); vButtonLayout.addComponent(btnLeft); btnRight = new Button(); btnRight.setWidth(100f, Unit.PERCENTAGE); btnRight.setIcon(FontAwesome.ANGLE_RIGHT); vButtonLayout.addComponent(btnRight); btnRightAll = new Button(); btnRightAll.setWidth(100f, Unit.PERCENTAGE); btnRightAll.setIcon(FontAwesome.ANGLE_DOUBLE_RIGHT); vButtonLayout.addComponent(btnRightAll); msRight = new MultiSelectUI(searchField); msRight.setWidth(100.0f, Unit.PERCENTAGE); hLayout.addComponent(msRight); hLayout.setExpandRatio(msRight, .45f); HorizontalLayout hlButtonFooter = new HorizontalLayout(); hlButtonFooter.setSpacing(true); addComponent(hlButtonFooter); setComponentAlignment(hlButtonFooter, Alignment.BOTTOM_RIGHT); btnSave = new Button(BundleUtils.getLanguage("lbl.save"), FontAwesome.SAVE); hlButtonFooter.addComponent(btnSave); btnCancel = new Button(BundleUtils.getLanguage("lbl.cancel"), FontAwesome.BAN); hlButtonFooter.addComponent(btnCancel); }
From source file:com.dungnv.streetfood.view.ArticleSearchDetail.java
private void init() { layout = new VerticalLayout(); layout.setSpacing(true);/*from www . java2 s . com*/ layout.setMargin(true); form = new FormLayout(); form.addStyleName("light"); // form.addStyleName("outlined"); form.setSizeFull(); form.setMargin(true); form.setSpacing(true); layout.addComponent(form); tfTitle = new TextField(BundleUtils.getLanguage("lbl.article.title")); tfTitle.setWidth(80.0f, Unit.PERCENTAGE); form.addComponent(tfTitle); tfShortContent = new TextField(BundleUtils.getLanguage("lbl.article.shortContent")); tfShortContent.setWidth(80.0f, Unit.PERCENTAGE); form.addComponent(tfShortContent); HorizontalLayout hlStatus = new HorizontalLayout(); hlStatus.setCaption(BundleUtils.getLanguage("lbl.status")); hlStatus.addStyleName("horizontal"); hlStatus.setSpacing(true); form.addComponent(hlStatus); tagSuggestFieldUI = new TagSuggestFieldUI(false); tagSuggestFieldUI.setWidth(80.0f, Unit.PERCENTAGE); form.addComponent(tagSuggestFieldUI); HorizontalLayout hlButton = new HorizontalLayout(); hlButton.setSpacing(true); hlButton.setMargin(true); form.addComponent(hlButton); btnSearch = new Button(BundleUtils.getLanguage("lbl.search"), FontAwesome.SEARCH); hlButton.addComponent(btnSearch); btnCancel = new Button(BundleUtils.getLanguage("lbl.cancel"), FontAwesome.BAN); hlButton.addComponent(btnCancel); }