List of usage examples for com.vaadin.ui Alignment MIDDLE_LEFT
Alignment MIDDLE_LEFT
To view the source code for com.vaadin.ui Alignment MIDDLE_LEFT.
Click Source Link
From source file:com.m1kah.ui.TodoComponent.java
License:Open Source License
private void initFooter() { itemsLeftLabel = new Label("0 items left"); filterOptionGroup = new OptionGroup(); filterOptionGroup.setId("filter-radio"); for (TodoFilter todoFilter : TodoFilter.values()) { filterOptionGroup.addItem(todoFilter); }// w w w .j av a 2 s . c o m filterOptionGroup.setValue(filter); clearCompletedButton = new Button("Clear completed"); HorizontalLayout footerLayout = new HorizontalLayout(itemsLeftLabel, filterOptionGroup, clearCompletedButton); footerLayout.setWidth(100.0f, Unit.PERCENTAGE); footerLayout.setComponentAlignment(itemsLeftLabel, Alignment.MIDDLE_LEFT); footerLayout.setComponentAlignment(filterOptionGroup, Alignment.MIDDLE_CENTER); footerLayout.setComponentAlignment(clearCompletedButton, Alignment.MIDDLE_RIGHT); footerLayout.setExpandRatio(itemsLeftLabel, 0.25f); footerLayout.setExpandRatio(filterOptionGroup, 0.5f); footerLayout.setExpandRatio(clearCompletedButton, 0.25f); addComponent(footerLayout); }
From source file:com.m1kah.ui.TodoRow.java
License:Open Source License
private void initLayout() { addComponent(checkBox);//from w w w . j a v a 2s .co m addComponent(todoField); addComponent(removeButton); setComponentAlignment(checkBox, Alignment.MIDDLE_LEFT); setComponentAlignment(todoField, Alignment.MIDDLE_LEFT); setComponentAlignment(removeButton, Alignment.MIDDLE_RIGHT); setExpandRatio(todoField, 1); addStyleName("todo-row"); setWidth(100.0f, Unit.PERCENTAGE); }
From source file:com.mcparland.john.vaadin_mvn_arch.samples.crud.SampleCrudView.java
License:Apache License
public HorizontalLayout createTopBar() { TextField filter = new TextField(); filter.setStyleName("filter-textfield"); filter.setInputPrompt("Filter"); ResetButtonForTextField.extend(filter); filter.setImmediate(true);/*from w w w.j a va 2 s . c o m*/ filter.addTextChangeListener(new FieldEvents.TextChangeListener() { /** * The serialVersionUID. */ private static final long serialVersionUID = 1L; @Override public void textChange(FieldEvents.TextChangeEvent event) { table.setFilter(event.getText()); } }); newProduct = new Button("New product"); newProduct.addStyleName(ValoTheme.BUTTON_PRIMARY); newProduct.setIcon(FontAwesome.PLUS_CIRCLE); newProduct.addClickListener(new ClickListener() { /** * The serialVersionUID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { viewLogic.newProduct(); } }); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setSpacing(true); topLayout.setWidth("100%"); topLayout.addComponent(filter); topLayout.addComponent(newProduct); topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT); topLayout.setExpandRatio(filter, 1); topLayout.setStyleName("top-bar"); return topLayout; }
From source file:com.mcparland.john.vaadin_mvn_arch.samples.Menu.java
License:Apache License
public Menu(Navigator navigator) { this.navigator = navigator; setPrimaryStyleName(ValoTheme.MENU_ROOT); menuPart = new CssLayout(); menuPart.addStyleName(ValoTheme.MENU_PART); // header of the menu final HorizontalLayout top = new HorizontalLayout(); top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); top.addStyleName(ValoTheme.MENU_TITLE); top.setSpacing(true);/*from w ww . j a v a2 s . c o m*/ Label title = new Label("My CRUD"); title.addStyleName(ValoTheme.LABEL_H3); title.setSizeUndefined(); Image image = new Image(null, new ThemeResource("img/table-logo.png")); image.setStyleName("logo"); top.addComponent(image); top.addComponent(title); menuPart.addComponent(top); // logout menu item MenuBar logoutMenu = new MenuBar(); logoutMenu.addItem("Logout", FontAwesome.SIGN_OUT, new Command() { /** * The serialVersionUID. */ private static final long serialVersionUID = 1L; @Override public void menuSelected(MenuItem selectedItem) { VaadinSession.getCurrent().getSession().invalidate(); Page.getCurrent().reload(); } }); logoutMenu.addStyleName("user-menu"); menuPart.addComponent(logoutMenu); // button for toggling the visibility of the menu when on a small screen final Button showMenu = new Button("Menu", new ClickListener() { /** * The serialVersionUID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) { menuPart.removeStyleName(VALO_MENU_VISIBLE); } else { menuPart.addStyleName(VALO_MENU_VISIBLE); } } }); showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenu.addStyleName(ValoTheme.BUTTON_SMALL); showMenu.addStyleName(VALO_MENU_TOGGLE); showMenu.setIcon(FontAwesome.NAVICON); menuPart.addComponent(showMenu); // container for the navigation buttons, which are added by addView() menuItemsLayout = new CssLayout(); menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS); menuPart.addComponent(menuItemsLayout); addComponent(menuPart); }
From source file:com.mechanicshop.components.DataEntryLayout.java
private void buildLayout() { FormLayout formLayout1 = new FormLayout(); formLayout1.setMargin(new MarginInfo(false, false, false, true)); formLayout1.setSpacing(true);//from w w w. ja v a 2 s .c o m FormLayout formLayout2 = new FormLayout(); formLayout2.setMargin(new MarginInfo(false, false, false, true)); formLayout2.setSpacing(true); FormLayout formLayout3 = new FormLayout(); formLayout3.setMargin(new MarginInfo(false, true, false, true)); formLayout3.setSpacing(true); tfTag.setStyleName(ValoTheme.TEXTFIELD_TINY); tfTag.setWidth("180px"); tfTag.setMaxLength(3); tfTag.setNullRepresentation(""); tfPhone.setStyleName(ValoTheme.TEXTFIELD_TINY); tfPhone.setWidth("180px"); tfPhone.setNullRepresentation(""); tfPhone.setMaxLength(11); tfName.setStyleName(ValoTheme.TEXTFIELD_TINY); tfName.setWidth("180px"); tfName.setMaxLength(50); tfName.setNullRepresentation(""); tfVehicle.setWidth("180px"); tfVehicle.setStyleName(ValoTheme.TEXTFIELD_TINY); tfVehicle.setMaxLength(75); tfVehicle.setNullRepresentation(""); tfLicensePlate.setStyleName(ValoTheme.TEXTFIELD_TINY); tfLicensePlate.setWidth("180px"); tfLicensePlate.setMaxLength(10); tfLicensePlate.setNullRepresentation(""); tfVin.setWidth("180px"); tfVin.setStyleName(ValoTheme.TEXTFIELD_TINY); tfVin.setMaxLength(17); tfVin.setNullRepresentation(""); dfInShop.setImmediate(true); dfInShop.addStyleName(ValoTheme.DATEFIELD_TINY); dfInShop.setInputPrompt("Select"); dfInShop.setWidth("120px"); dfOutShop.setImmediate(true); dfOutShop.addStyleName(ValoTheme.DATEFIELD_TINY); dfOutShop.setInputPrompt("Select"); dfOutShop.setWidth("120px"); nsStatus.addItems("In", "Out", "Pending", "Ready", "Comeback"); nsStatus.setImmediate(true); nsStatus.setWidth("120px"); nsStatus.setStyleName(ValoTheme.COMBOBOX_TINY); nsStatus.setValue("In"); tfMileage.setWidth("120px"); tfMileage.setStyleName(ValoTheme.TEXTFIELD_TINY); tfMileage.setMaxLength(6); tfMileage.setNullRepresentation(""); tfPicked.setWidth("120px"); tfPicked.setStyleName(ValoTheme.TEXTFIELD_TINY); tfPicked.setMaxLength(3); tfPicked.setNullRepresentation(""); tfPayment.setWidth("180px"); tfPayment.setStyleName(ValoTheme.TEXTFIELD_TINY); tfPayment.setMaxLength(50); tfPayment.setNullRepresentation(""); taRemarks.setWidth("500px"); taRemarks.setStyleName(ValoTheme.TEXTFIELD_TINY); taRemarks.setMaxLength(500); taRemarks.setNullRepresentation(""); tfRebuilder.setWidth("180px"); tfRebuilder.setStyleName(ValoTheme.TEXTFIELD_TINY); tfRebuilder.setMaxLength(20); tfRebuilder.setNullRepresentation(""); tfInstaller.setWidth("180px"); tfInstaller.setStyleName(ValoTheme.TEXTFIELD_TINY); tfInstaller.setMaxLength(20); tfInstaller.setNullRepresentation(""); tfFirstCheckBy.setWidth("500px"); tfFirstCheckBy.setStyleName(ValoTheme.TEXTFIELD_TINY); tfFirstCheckBy.setMaxLength(100); tfFirstCheckBy.setNullRepresentation(""); tfSecondCheckBy.setWidth("500px"); tfSecondCheckBy.setStyleName(ValoTheme.TEXTFIELD_TINY); tfSecondCheckBy.setMaxLength(100); tfSecondCheckBy.setNullRepresentation(""); dfFirstCheckDate.setImmediate(true); dfFirstCheckDate.addStyleName(ValoTheme.DATEFIELD_TINY); dfFirstCheckDate.setInputPrompt("Select"); dfFirstCheckDate.setWidth("120px"); dfSecondCheckDate.setImmediate(true); dfSecondCheckDate.addStyleName(ValoTheme.DATEFIELD_TINY); dfSecondCheckDate.setInputPrompt("Select"); dfSecondCheckDate.setWidth("120px"); taMedia.setWidth("500px"); taMedia.setStyleName(ValoTheme.TEXTFIELD_TINY); taMedia.setNullRepresentation(""); taMedia2.setWidth("500px"); taMedia2.setStyleName(ValoTheme.TEXTFIELD_TINY); taMedia2.setNullRepresentation(""); tfReferedBy.setWidth("180px"); tfReferedBy.setStyleName(ValoTheme.TEXTFIELD_TINY); tfReferedBy.setMaxLength(20); tfReferedBy.setNullRepresentation(""); tfWarrantyLimit.setWidth("180px"); tfWarrantyLimit.setStyleName(ValoTheme.TEXTFIELD_TINY); tfWarrantyLimit.setMaxLength(5); tfWarrantyLimit.setNullRepresentation(""); nsWarranty.setWidth("120px"); nsWarranty.setStyleName(ValoTheme.TEXTFIELD_TINY); nsWarranty.addItems("YES", "NO"); nsWarranty.setValue("NO"); nsWarranty.setStyleName(ValoTheme.COMBOBOX_TINY); nsSMS.setWidth("120px"); nsSMS.setStyleName(ValoTheme.TEXTFIELD_TINY); nsSMS.addItems("YES", "NO"); nsSMS.setValue("NO"); nsComeback.setWidth("120px"); nsComeback.setStyleName(ValoTheme.TEXTFIELD_TINY); nsComeback.addItems("YES", "NO"); nsComeback.setValue("NO"); nsComeback.setStyleName(ValoTheme.COMBOBOX_TINY); formLayout1.addComponents(tfTag, tfPhone, tfName, tfVehicle, tfPayment, tfRebuilder, tfInstaller, tfLicensePlate, tfVin, tfReferedBy, tfWarrantyLimit); formLayout2.addComponents(nsWarranty, dfInShop, dfOutShop, nsStatus, nsSMS, nsComeback, tfMileage, tfPicked, dfFirstCheckDate, dfSecondCheckDate); formLayout3.addComponents(tfFirstCheckBy, tfSecondCheckBy, taRemarks, taMedia, taMedia2); HorizontalLayout layoutButtons = new HorizontalLayout(); layoutButtons.setMargin(new MarginInfo(false, true, false, true)); sendBtn.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { Integer tag = null; Integer mileage = null; if (tfTag.getValue() != null) if (!tfTag.getValue().isEmpty()) { tag = (Integer.parseInt(tfTag.getValue())); } else tag = null; if (tfMileage.getValue() != null) if (!tfMileage.getValue().isEmpty()) { mileage = (Integer.parseInt(tfMileage.getValue())); } else mileage = null; Object[] args = new Object[] { tag, tfPhone.getValue(), tfName.getValue(), tfVehicle.getValue(), tfLicensePlate.getValue(), tfVin.getValue(), dfInShop.getValue(), dfOutShop.getValue(), nsStatus.getValue(), mileage, tfPicked.getValue(), tfPayment.getValue(), taRemarks.getValue(), tfRebuilder.getValue(), tfInstaller.getValue(), tfFirstCheckBy.getValue(), tfSecondCheckBy.getValue(), dfFirstCheckDate.getValue(), dfSecondCheckDate.getValue(), taMedia.getValue(), taMedia2.getValue(), tfReferedBy.getValue(), tfWarrantyLimit.getValue(), nsWarranty.getValue(), nsSMS.getValue(), nsComeback.getValue() }; if (sendBtn.getCaption().equals("Add")) { try { String status = nsStatus.getValue().toString(); searchService.insertCar(args, status); Notification.show("Entry inserted succesfully"); close(); } catch (Exception e) { e.printStackTrace(); Notification.show("An error has occurred", Notification.Type.ERROR_MESSAGE); } } else { try { searchService.editCar(args, tableName, no); Notification.show("Entry edited succesfully"); close(); } catch (Exception e) { e.printStackTrace(); Notification.show("An error has occurred", Notification.Type.ERROR_MESSAGE); } } } }); sendBtn.setImmediate(true); sendBtn.setStyleName(ValoTheme.BUTTON_TINY); sendBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY); layoutButtons.setSizeUndefined(); layoutButtons.setSpacing(true); layoutButtons.addComponents(sendBtn); hLayoutForms.addComponents(formLayout1, formLayout2, formLayout3); mainLayout.addComponent(hLayoutForms); mainLayout.addComponent(layoutButtons); mainLayout.setComponentAlignment(hLayoutForms, Alignment.MIDDLE_CENTER); mainLayout.setComponentAlignment(layoutButtons, Alignment.MIDDLE_LEFT); mainLayout.setExpandRatio(hLayoutForms, 3); }
From source file:com.mechanicshop.components.MaintenanceLayout.java
private void buildLayout() { HorizontalLayout layoutTitle = new HorizontalLayout(); layoutTitle.setSizeUndefined();// w ww. j av a2 s. c om layoutTitle.setWidth("100%"); layoutTitle.setSpacing(false); layoutTitle.setMargin(false); titleLabel.addStyleName(ValoTheme.LABEL_H2); titleLabel.addStyleName(ValoTheme.LABEL_COLORED); titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN); titleLabel.addStyleName(ValoTheme.LABEL_BOLD); titleLabel.setSizeUndefined(); layoutTitle.addComponent(titleLabel); layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER); VerticalLayout layoutTable = new VerticalLayout(); layoutTable.setSizeFull(); layoutTable.setSpacing(true); HorizontalLayout layoutButtons = new HorizontalLayout(); layoutButtons.setMargin(false); layoutButtons.setSpacing(true); layoutButtons.setSizeUndefined(); Button passwordBtn = new Button("Edit Password"); passwordBtn.addClickListener(passwordListener); passwordBtn.setImmediate(true); passwordBtn.setIcon(FontAwesome.EDIT); passwordBtn.setStyleName(ValoTheme.BUTTON_TINY); Button media1Btn = new Button("Media 1 Default Text"); media1Btn.setStyleName(ValoTheme.BUTTON_TINY); media1Btn.setImmediate(true); media1Btn.setIcon(FontAwesome.EDIT); media1Btn.addClickListener(media1Listener); Button media2Btn = new Button("Media 2 Default Text"); media2Btn.setStyleName(ValoTheme.BUTTON_TINY); media2Btn.setImmediate(true); media2Btn.setIcon(FontAwesome.EDIT); media2Btn.addClickListener(media2Listener); layoutButtons.addComponents(passwordBtn, media1Btn, media2Btn); layoutButtons.setComponentAlignment(passwordBtn, Alignment.MIDDLE_LEFT); layoutButtons.setComponentAlignment(media1Btn, Alignment.MIDDLE_LEFT); layoutButtons.setComponentAlignment(media2Btn, Alignment.MIDDLE_LEFT); addComponent(layoutTitle); addComponent(layoutTable); layoutTable.addComponent(layoutButtons); layoutTable.addComponent(table); layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER); layoutTable.setExpandRatio(table, 3); setComponentAlignment(layoutTitle, Alignment.TOP_CENTER); setComponentAlignment(layoutTable, Alignment.TOP_CENTER); setExpandRatio(layoutTable, 3); setSpacing(true); setMargin(true); }
From source file:com.mechanicshop.components.TableLayout.java
private void buildLayout() { HorizontalLayout layoutTitle = new HorizontalLayout(); layoutTitle.setSizeUndefined();// w ww . ja v a2 s .c om layoutTitle.setWidth("100%"); layoutTitle.setSpacing(false); layoutTitle.setMargin(false); titleLabel.addStyleName(ValoTheme.LABEL_H2); titleLabel.addStyleName(ValoTheme.LABEL_COLORED); titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN); titleLabel.addStyleName(ValoTheme.LABEL_BOLD); titleLabel.setSizeUndefined(); layoutTitle.addComponent(titleLabel); layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER); VerticalLayout layoutTable = new VerticalLayout(); layoutTable.addComponent(table); layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER); layoutTable.setSizeFull(); layoutTable.setSpacing(true); HorizontalLayout layoutButtons = new HorizontalLayout(); layoutButtons.setMargin(false); layoutButtons.setSpacing(true); layoutButtons.setSizeUndefined(); layoutButtons.setWidth("100%"); Button addBtn = new Button("Add new Car"); addBtn.addClickListener(addBtnListener); addBtn.setImmediate(true); addBtn.setStyleName(ValoTheme.BUTTON_TINY); addBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY); Button deleteBtn = new Button("Delete Selected"); deleteBtn.setStyleName(ValoTheme.BUTTON_TINY); deleteBtn.addStyleName(ValoTheme.BUTTON_DANGER); deleteBtn.setImmediate(true); deleteBtn.addClickListener(removeListener); btnSendSMS.setStyleName(ValoTheme.BUTTON_TINY); btnSendSMS.addStyleName(ValoTheme.BUTTON_FRIENDLY); btnSendSMS.setImmediate(true); btnSendSMS.addClickListener(sendSMSBtnListener); searchTextField.setImmediate(true); searchTextField.addStyleName(ValoTheme.TEXTFIELD_TINY); searchTextField.addTextChangeListener(filterChangeListener); Label lbSearch = new Label("Search"); lbSearch.addStyleName(ValoTheme.LABEL_TINY); lbSearch.setSizeUndefined(); layoutButtons.addComponents(lbSearch, searchTextField, addBtn, deleteBtn, btnSendSMS); layoutButtons.setComponentAlignment(lbSearch, Alignment.MIDDLE_LEFT); layoutButtons.setComponentAlignment(searchTextField, Alignment.BOTTOM_LEFT); layoutButtons.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT); layoutButtons.setComponentAlignment(deleteBtn, Alignment.BOTTOM_RIGHT); layoutButtons.setComponentAlignment(btnSendSMS, Alignment.BOTTOM_RIGHT); layoutButtons.setExpandRatio(addBtn, 3); addComponent(layoutTitle); addComponent(layoutTable); layoutTable.addComponent(layoutButtons); layoutTable.setExpandRatio(table, 3); setComponentAlignment(layoutTitle, Alignment.TOP_CENTER); setComponentAlignment(layoutTable, Alignment.TOP_CENTER); setExpandRatio(layoutTable, 3); setSpacing(true); setMargin(true); }
From source file:com.mycollab.mobile.module.crm.view.account.AccountReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { HorizontalLayout toolbarLayout = new HorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); toolbarLayout.setSpacing(true);//from www . ja va2 s . c o m Button relatedContacts = new Button(); relatedContacts.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_CONTACT + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(ContactI18nEnum.LIST) + "</div>"); relatedContacts.setHtmlContentAllowed(true); relatedContacts.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new AccountEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateContacts)))); toolbarLayout.addComponent(relatedContacts); Button relatedOpportunities = new Button(); relatedOpportunities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_OPPORTUNITY + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(OpportunityI18nEnum.LIST) + "</div>"); relatedOpportunities.setHtmlContentAllowed(true); relatedOpportunities.addClickListener(clickEvent -> EventBusFactory.getInstance().post( new AccountEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateOpportunities)))); toolbarLayout.addComponent(relatedOpportunities); Button relatedLeads = new Button(); relatedLeads.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_LEAD + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(LeadI18nEnum.LIST) + "</div>"); relatedLeads.setHtmlContentAllowed(true); relatedLeads.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new AccountEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateLeads)))); toolbarLayout.addComponent(relatedLeads); Button relatedActivities = new Button(); relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>"); relatedActivities.setHtmlContentAllowed(true); relatedActivities.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new AccountEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateActivities)))); toolbarLayout.addComponent(relatedActivities); return toolbarLayout; }
From source file:com.mycollab.mobile.module.crm.view.activity.AssignmentReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { MHorizontalLayout toolbarLayout = new MHorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); return toolbarLayout; }
From source file:com.mycollab.mobile.module.crm.view.campaign.CampaignReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { HorizontalLayout toolbarLayout = new HorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); toolbarLayout.setSpacing(true);//from w w w . j av a 2s . co m Button relatedAccounts = new Button(); relatedAccounts.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACCOUNT + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(AccountI18nEnum.LIST) + "</div>"); relatedAccounts.setHtmlContentAllowed(true); relatedAccounts.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new CampaignEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateAccounts)))); toolbarLayout.addComponent(relatedAccounts); Button relatedContacts = new Button(); relatedContacts.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_CONTACT + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(ContactI18nEnum.LIST) + "</div>"); relatedContacts.setHtmlContentAllowed(true); relatedContacts.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new CampaignEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateContacts)))); toolbarLayout.addComponent(relatedContacts); Button relatedLeads = new Button(); relatedLeads.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_LEAD + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(LeadI18nEnum.LIST) + "</div>"); relatedLeads.setHtmlContentAllowed(true); relatedLeads.addClickListener(clickEvent -> EventBusFactory.getInstance() .post(new CampaignEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateLeads)))); toolbarLayout.addComponent(relatedLeads); Button relatedActivities = new Button(); relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY + "\"></span><div class=\"screen-reader-text\">" + UserUIContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>"); relatedActivities.setHtmlContentAllowed(true); relatedActivities.addClickListener(clickEvent -> EventBusFactory.getInstance().post( new CampaignEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateActivities)))); toolbarLayout.addComponent(relatedActivities); return toolbarLayout; }