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.mycollab.module.crm.ui.components.CrmActivityComponent.java
License:Open Source License
public CrmActivityComponent(String type) { withMargin(false).withStyleName("activity-comp"); this.type = type; this.groupFormatter = AuditLogRegistry.getFieldGroupFormatterOfType(type); headerLbl = new ELabel(""); final OptionGroup sortDirection = new OptionGroup(); sortDirection.addStyleName("sortDirection"); String oldestFirstDirection = UserUIContext.getMessage(GenericI18Enum.OPT_OLDEST_FIRST); final String newestFirstDirection = UserUIContext.getMessage(GenericI18Enum.OPT_NEWEST_FIRST); sortDirection.addItems(newestFirstDirection, oldestFirstDirection); sortDirection.setValue(newestFirstDirection); sortDirection.addValueChangeListener(valueChangeEvent -> { Object value = sortDirection.getValue(); isAscending = newestFirstDirection.equals(value); displayActivities();// ww w .j a va 2s.co m }); MHorizontalLayout headerPanel = new MHorizontalLayout().withMargin(new MarginInfo(false, true, false, true)) .withStyleName(WebThemes.FORM_SECTION, WebThemes.HOVER_EFFECT_NOT_BOX).withFullWidth() .with(headerLbl, sortDirection).withAlign(headerLbl, Alignment.MIDDLE_LEFT) .withAlign(sortDirection, Alignment.MIDDLE_RIGHT); commentBox = new CrmCommentInput(this, type); activityBox = new MVerticalLayout().withMargin(new MarginInfo(false, true, false, false)); this.with(headerPanel, commentBox, activityBox); commentService = AppContextUtil.getSpringBean(CommentService.class); auditLogService = AppContextUtil.getSpringBean(AuditLogService.class); }
From source file:com.mycollab.module.crm.ui.components.CrmActivityComponent.java
License:Open Source License
private Component buildCommentBlock(final SimpleComment comment) { final MHorizontalLayout layout = new MHorizontalLayout() .withMargin(new MarginInfo(true, false, true, false)).withFullWidth(); ProjectMemberBlock memberBlock = new ProjectMemberBlock(comment.getCreateduser(), comment.getOwnerAvatarId(), comment.getOwnerFullName()); layout.addComponent(memberBlock);//from w w w.j a v a 2 s. c om MVerticalLayout rowLayout = new MVerticalLayout().withFullWidth() .withStyleName(WebThemes.MESSAGE_CONTAINER); MHorizontalLayout messageHeader = new MHorizontalLayout().withFullWidth(); messageHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ELabel timePostLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.EXT_ADDED_COMMENT, comment.getOwnerFullName(), UserUIContext.formatPrettyTime(comment.getCreatedtime())), ContentMode.HTML).withDescription(UserUIContext.formatDateTime(comment.getCreatedtime())); timePostLbl.setStyleName(UIConstants.META_INFO); if (hasDeletePermission(comment)) { MButton msgDeleteBtn = new MButton("", clickEvent -> ConfirmDialogExt.show(UI.getCurrent(), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, MyCollabUI.getSiteName()), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE), UserUIContext.getMessage(GenericI18Enum.BUTTON_YES), UserUIContext.getMessage(GenericI18Enum.BUTTON_NO), confirmDialog -> { if (confirmDialog.isConfirmed()) { CommentService commentService = AppContextUtil .getSpringBean(CommentService.class); commentService.removeWithSession(comment, UserUIContext.getUsername(), MyCollabUI.getAccountId()); activityBox.removeComponent(layout); } })).withIcon(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_ICON_ONLY); messageHeader.with(timePostLbl, msgDeleteBtn).expand(timePostLbl); } else { messageHeader.with(timePostLbl).expand(timePostLbl); } rowLayout.addComponent(messageHeader); Label messageContent = new SafeHtmlLabel(comment.getComment()); rowLayout.addComponent(messageContent); List<Content> attachments = comment.getAttachments(); if (!CollectionUtils.isEmpty(attachments)) { MVerticalLayout messageFooter = new MVerticalLayout().withMargin(false).withSpacing(false) .withFullWidth(); AttachmentDisplayComponent attachmentDisplay = new AttachmentDisplayComponent(attachments); attachmentDisplay.setWidth("100%"); messageFooter.with(attachmentDisplay); rowLayout.addComponent(messageFooter); } layout.with(rowLayout).expand(rowLayout); return layout; }
From source file:com.mycollab.module.crm.ui.components.CrmActivityComponent.java
License:Open Source License
private Component buildAuditBlock(SimpleAuditLog auditLog) { List<AuditChangeItem> changeItems = auditLog.getChangeItems(); if (CollectionUtils.isNotEmpty(changeItems)) { final MHorizontalLayout layout = new MHorizontalLayout() .withMargin(new MarginInfo(true, false, true, false)).withFullWidth(); ProjectMemberBlock memberBlock = new ProjectMemberBlock(auditLog.getPosteduser(), auditLog.getPostedUserAvatarId(), auditLog.getPostedUserFullName()); layout.addComponent(memberBlock); MVerticalLayout rowLayout = new MVerticalLayout().withFullWidth() .withStyleName(WebThemes.MESSAGE_CONTAINER); MHorizontalLayout messageHeader = new MHorizontalLayout().withFullWidth(); messageHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ELabel timePostLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.EXT_MODIFIED_ITEM, auditLog.getPostedUserFullName(), UserUIContext.formatPrettyTime(auditLog.getPosteddate())), ContentMode.HTML).withDescription(UserUIContext.formatDateTime(auditLog.getPosteddate())); timePostLbl.setStyleName(UIConstants.META_INFO); messageHeader.with(timePostLbl).expand(timePostLbl); rowLayout.addComponent(messageHeader); for (AuditChangeItem item : changeItems) { String fieldName = item.getField(); DefaultFieldDisplayHandler fieldDisplayHandler = groupFormatter.getFieldDisplayHandler(fieldName); if (fieldDisplayHandler != null) { Span fieldBlock = new Span() .appendText(UserUIContext.getMessage(fieldDisplayHandler.getDisplayName())) .setCSSClass(UIConstants.BLOCK); Div historyDiv = new Div().appendChild(fieldBlock) .appendText(fieldDisplayHandler.getFormat().toString(item.getOldvalue())) .appendText(" " + FontAwesome.LONG_ARROW_RIGHT.getHtml() + " ") .appendText(fieldDisplayHandler.getFormat().toString(item.getNewvalue())); rowLayout.addComponent(new Label(historyDiv.write(), ContentMode.HTML)); }//ww w . j a v a2 s . co m } layout.with(rowLayout).expand(rowLayout); return layout; } else { return null; } }
From source file:com.mycollab.module.crm.ui.components.CrmFollowersComp.java
License:Open Source License
public void displayFollowers(final V bean) { this.bean = bean; try {//from w w w. j a va 2s . c om typeId = (Integer) PropertyUtils.getProperty(bean, "id"); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { LOG.error("Error", e); return; } this.removeAllComponents(); MHorizontalLayout header = new MHorizontalLayout().withStyleName("info-hdr"); header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); Label followerHeader = new Label( FontAwesome.EYE.getHtml() + " " + UserUIContext.getMessage(FollowerI18nEnum.OPT_SUB_INFO_WATCHERS), ContentMode.HTML); header.addComponent(followerHeader); if (hasEditPermission()) { final PopupView addPopupView = new PopupView(UserUIContext.getMessage(GenericI18Enum.ACTION_MODIFY), new MVerticalLayout()); addPopupView.addPopupVisibilityListener(popupVisibilityEvent -> { PopupView.Content content = addPopupView.getContent(); if (popupVisibilityEvent.isPopupVisible()) { MVerticalLayout popupComponent = (MVerticalLayout) content.getPopupComponent(); popupComponent.removeAllComponents(); popupComponent.with(new ELabel(UserUIContext.getMessage(FollowerI18nEnum.OPT_SUB_INFO_WATCHERS)) .withStyleName(ValoTheme.LABEL_H3), new ModifyWatcherPopup()); } else { MVerticalLayout popupComponent = (MVerticalLayout) content.getPopupComponent(); ModifyWatcherPopup popup = (ModifyWatcherPopup) popupComponent.getComponent(1); List<MonitorItem> unsavedItems = popup.getUnsavedItems(); monitorItemService.saveMonitorItems(unsavedItems); loadWatchers(); } }); header.addComponent(addPopupView); } header.addComponent(ELabel.fontIcon(FontAwesome.QUESTION_CIRCLE).withStyleName(WebThemes.INLINE_HELP) .withDescription(UserUIContext.getMessage(FollowerI18nEnum.FOLLOWER_EXPLAIN_HELP))); this.addComponent(header); watcherLayout = new MCssLayout().withFullWidth().withStyleName(WebThemes.FLEX_DISPLAY); this.addComponent(watcherLayout); loadWatchers(); }
From source file:com.mycollab.module.crm.ui.components.RelatedEditItemField.java
License:Open Source License
@Override protected Component initContent() { return new MHorizontalLayout(relatedItemComboBox, itemField, browseBtn, clearBtn) .alignAll(Alignment.MIDDLE_LEFT); }
From source file:com.mycollab.module.crm.view.account.AccountSelectionField.java
License:Open Source License
@Override protected Component initContent() { MHorizontalLayout layout = new MHorizontalLayout().withFullWidth(); layout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); accountName.setNullRepresentation(""); accountName.setEnabled(true);//from w w w . j a v a 2s . co m accountName.setWidth("100%"); MButton browseBtn = new MButton("", clickEvent -> { AccountSelectionWindow accountWindow = new AccountSelectionWindow(AccountSelectionField.this); UI.getCurrent().addWindow(accountWindow); accountWindow.show(); }).withIcon(FontAwesome.ELLIPSIS_H).withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING); MButton clearBtn = new MButton("", clickEvent -> clearValue()).withIcon(FontAwesome.TRASH_O) .withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING); layout.with(accountName, browseBtn, clearBtn).expand(accountName); return layout; }
From source file:com.mycollab.module.crm.view.activity.ActivityCalendarViewImpl.java
License:Open Source License
private void initContent() { MHorizontalLayout contentWrapper = new MHorizontalLayout().withSpacing(false).withFullWidth(); this.addComponent(contentWrapper); /* Content cheat */ MVerticalLayout mainContent = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true)) .withFullWidth().withStyleName("readview-layout"); contentWrapper.with(mainContent).expand(mainContent); MVerticalLayout rightColumn = new MVerticalLayout().withMargin(new MarginInfo(true, false, true, false)) .withWidth("250px"); rightColumn.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); contentWrapper.addComponent(rightColumn); MHorizontalLayout actionPanel = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, false)) .withFullWidth().withStyleName(WebThemes.HEADER_VIEW); actionPanel.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); Component headerText = ComponentUtils.header(CrmTypeConstants.ACTIVITY, "Calendar"); actionPanel.with(headerText).expand(headerText); mainContent.addComponent(actionPanel); dateHdr = new Label(); dateHdr.setSizeUndefined();/* ww w . ja v a 2 s. c o m*/ dateHdr.setStyleName(ValoTheme.LABEL_H3); mainContent.addComponent(this.dateHdr); mainContent.setComponentAlignment(this.dateHdr, Alignment.MIDDLE_CENTER); toggleViewBtn = new PopupButton(UserUIContext.getMessage(DayI18nEnum.OPT_MONTHLY)); toggleViewBtn.setWidth("200px"); toggleViewBtn.addStyleName("calendar-view-switcher"); MVerticalLayout popupLayout = new MVerticalLayout().withMargin(new MarginInfo(false, true, false, true)) .withWidth("190px"); monthViewBtn = new Button(UserUIContext.getMessage(DayI18nEnum.OPT_MONTHLY), clickEvent -> { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(monthViewBtn.getCaption()); calendarComponent.switchToMonthView(new Date(), true); datePicker.selectDate(new Date()); monthViewBtn.addStyleName("selected-style"); initLabelCaption(); }); monthViewBtn.setStyleName(WebThemes.BUTTON_LINK); popupLayout.addComponent(monthViewBtn); weekViewBtn = new Button(UserUIContext.getMessage(DayI18nEnum.OPT_WEEKLY), clickEvent -> { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(weekViewBtn.getCaption()); calendarComponent.switchToWeekView(new Date()); datePicker.selectWeek(new Date()); }); weekViewBtn.setStyleName(WebThemes.BUTTON_LINK); popupLayout.addComponent(weekViewBtn); dailyViewBtn = new Button(UserUIContext.getMessage(DayI18nEnum.OPT_DAILY), clickEvent -> { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(dailyViewBtn.getCaption()); Date currentDate = new Date(); datePicker.selectDate(currentDate); calendarComponent.switchToDateView(currentDate); }); dailyViewBtn.setStyleName(WebThemes.BUTTON_LINK); popupLayout.addComponent(dailyViewBtn); toggleViewBtn.setContent(popupLayout); CssLayout toggleBtnWrap = new CssLayout(); toggleBtnWrap.setStyleName("switcher-wrap"); toggleBtnWrap.addComponent(toggleViewBtn); rightColumn.addComponent(toggleBtnWrap); rightColumn.setComponentAlignment(toggleBtnWrap, Alignment.MIDDLE_CENTER); rightColumn.addComponent(this.datePicker); initLabelCaption(); addCalendarEvent(); actionPanel.addComponent(calendarActionBtn); actionPanel.setComponentAlignment(calendarActionBtn, Alignment.MIDDLE_RIGHT); OptionPopupContent actionBtnLayout = new OptionPopupContent(); Button.ClickListener listener = new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { calendarActionBtn.setPopupVisible(false); String caption = event.getButton().getCaption(); if (caption.equals("New Task")) { EventBusFactory.getInstance().post(new ActivityEvent.TaskAdd(this, null)); } else if (caption.equals("New Call")) { EventBusFactory.getInstance().post(new ActivityEvent.CallAdd(this, null)); } else if (caption.equals("New Meeting")) { EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null)); } } }; MButton todoBtn = new MButton(UserUIContext.getMessage(TaskI18nEnum.NEW), listener) .withStyleName(WebThemes.BUTTON_LINK).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.TASK)) .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_TASK)); actionBtnLayout.addOption(todoBtn); MButton callBtn = new MButton(UserUIContext.getMessage(MeetingI18nEnum.NEW), listener) .withStyleName(WebThemes.BUTTON_LINK).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CALL)) .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_CALL)); actionBtnLayout.addOption(callBtn); MButton meetingBtn = new MButton(UserUIContext.getMessage(MeetingI18nEnum.NEW), listener) .withStyleName(WebThemes.BUTTON_LINK).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.MEETING)) .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_MEETING)); actionBtnLayout.addOption(meetingBtn); calendarActionBtn.setContent(actionBtnLayout); ButtonGroup viewSwitcher = new ButtonGroup(); Button calendarViewBtn = new Button("Calendar"); calendarViewBtn.setStyleName("selected"); calendarViewBtn.addStyleName(WebThemes.BUTTON_ACTION); viewSwitcher.addButton(calendarViewBtn); Button activityListBtn = new Button("Activities", event -> { ActivitySearchCriteria criteria = new ActivitySearchCriteria(); criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId())); EventBusFactory.getInstance().post(new ActivityEvent.GotoTodoList(this, null)); }); activityListBtn.addStyleName(WebThemes.BUTTON_ACTION); viewSwitcher.addButton(activityListBtn); actionPanel.addComponent(viewSwitcher); actionPanel.setComponentAlignment(viewSwitcher, Alignment.MIDDLE_RIGHT); calendarComponent = new CalendarDisplay(); mainContent.addComponent(calendarComponent); mainContent.setExpandRatio(calendarComponent, 1); mainContent.setComponentAlignment(calendarComponent, Alignment.MIDDLE_CENTER); HorizontalLayout spacing = new HorizontalLayout(); spacing.setHeight("30px"); mainContent.addComponent(spacing); HorizontalLayout noteInfoLayout = new HorizontalLayout(); noteInfoLayout.setSpacing(true); HorizontalLayout noteWapper = new HorizontalLayout(); noteWapper.setHeight("30px"); Label noteLbl = new Label(UserUIContext.getMessage(GenericI18Enum.OPT_NOTE)); noteWapper.addComponent(noteLbl); noteWapper.setComponentAlignment(noteLbl, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(noteWapper); HorizontalLayout completeWapper = new HorizontalLayout(); completeWapper.setWidth("100px"); completeWapper.setHeight("30px"); completeWapper.addStyleName("eventLblcompleted"); Label completeLabel = new Label("Completed"); completeWapper.addComponent(completeLabel); completeWapper.setComponentAlignment(completeLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(completeWapper); HorizontalLayout overdueWapper = new HorizontalLayout(); overdueWapper.setWidth("100px"); overdueWapper.setHeight("30px"); overdueWapper.addStyleName("eventLbloverdue"); Label overdueLabel = new Label("Overdue"); overdueWapper.addComponent(overdueLabel); overdueWapper.setComponentAlignment(overdueLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(overdueWapper); HorizontalLayout futureWapper = new HorizontalLayout(); futureWapper.setWidth("100px"); futureWapper.setHeight("30px"); futureWapper.addStyleName("eventLblfuture"); Label futureLabel = new Label("Future"); futureWapper.addComponent(futureLabel); futureWapper.setComponentAlignment(futureLabel, Alignment.MIDDLE_CENTER); noteInfoLayout.addComponent(futureWapper); mainContent.addComponent(noteInfoLayout); mainContent.setComponentAlignment(noteInfoLayout, Alignment.MIDDLE_CENTER); }
From source file:com.mycollab.module.crm.view.campaign.CampaignSelectionField.java
License:Open Source License
@Override protected Component initContent() { MHorizontalLayout layout = new MHorizontalLayout().withFullWidth(); layout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); MButton browseBtn = new MButton("", clickEvent -> { CampaignSelectionWindow campaignWindow = new CampaignSelectionWindow(CampaignSelectionField.this); UI.getCurrent().addWindow(campaignWindow); campaignWindow.show();/*from ww w. jav a 2 s . c o m*/ }).withIcon(FontAwesome.ELLIPSIS_H).withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING); MButton clearBtn = new MButton("", clickEvent -> { campaignName.setValue(""); internalValue = null; }).withIcon(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING); layout.with(campaignName, browseBtn, clearBtn).expand(campaignName); return layout; }
From source file:com.mycollab.module.crm.view.contact.ContactSelectionField.java
License:Open Source License
@Override protected Component initContent() { return new MHorizontalLayout(contactName, browseBtn, clearBtn).expand(contactName) .alignAll(Alignment.MIDDLE_LEFT).withFullWidth(); }
From source file:com.mycollab.module.crm.view.CrmModule.java
License:Open Source License
@Override public MHorizontalLayout buildMenu() { if (serviceMenuContainer == null) { serviceMenuContainer = new MHorizontalLayout(); serviceMenu = new ServiceMenu(); serviceMenu.addService(CrmTypeConstants.DASHBOARD, UserUIContext.getMessage(CrmCommonI18nEnum.TOOLBAR_DASHBOARD_HEADER), clickEvent -> EventBusFactory.getInstance().post(new CrmEvent.GotoHome(this, null))); serviceMenu.addService(CrmTypeConstants.ACCOUNT, UserUIContext.getMessage(AccountI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new AccountEvent.GotoList(this, null))); serviceMenu.addService(CrmTypeConstants.CONTACT, UserUIContext.getMessage(ContactI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new ContactEvent.GotoList(this, null))); serviceMenu.addService(CrmTypeConstants.LEAD, UserUIContext.getMessage(LeadI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new LeadEvent.GotoList(this, null))); serviceMenu.addService(CrmTypeConstants.CAMPAIGN, UserUIContext.getMessage(CampaignI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new CampaignEvent.GotoList(this, null))); serviceMenu.addService(CrmTypeConstants.OPPORTUNITY, UserUIContext.getMessage(OpportunityI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new OpportunityEvent.GotoList(this, null))); serviceMenu.addService(CrmTypeConstants.CASE, UserUIContext.getMessage(CaseI18nEnum.LIST), clickEvent -> EventBusFactory.getInstance().post(new CaseEvent.GotoList(this, null))); serviceMenuContainer.with(serviceMenu); Button.ClickListener listener = new CreateItemListener(); addPopupMenu = new PopupButton(UserUIContext.getMessage(GenericI18Enum.ACTION_NEW)); addPopupMenu.setIcon(FontAwesome.PLUS_CIRCLE); addPopupMenu.addStyleName("add-btn-popup"); addPopupMenu.setDirection(Alignment.BOTTOM_LEFT); OptionPopupContent popupButtonsControl = new OptionPopupContent(); if (UserUIContext.canWrite(RolePermissionCollections.CRM_ACCOUNT)) { Button newAccountBtn = new Button(UserUIContext.getMessage(AccountI18nEnum.SINGLE), listener); newAccountBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.ACCOUNT)); popupButtonsControl.addOption(newAccountBtn); }/* w w w .ja v a 2 s . c om*/ if (UserUIContext.canWrite(RolePermissionCollections.CRM_CONTACT)) { Button newContactBtn = new Button(UserUIContext.getMessage(ContactI18nEnum.SINGLE), listener); newContactBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CONTACT)); popupButtonsControl.addOption(newContactBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_CAMPAIGN)) { Button newCampaignBtn = new Button(UserUIContext.getMessage(CampaignI18nEnum.SINGLE), listener); newCampaignBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CAMPAIGN)); popupButtonsControl.addOption(newCampaignBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY)) { Button newOpportunityBtn = new Button(UserUIContext.getMessage(OpportunityI18nEnum.SINGLE), listener); newOpportunityBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.OPPORTUNITY)); popupButtonsControl.addOption(newOpportunityBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_LEAD)) { Button newLeadBtn = new Button(UserUIContext.getMessage(LeadI18nEnum.SINGLE), listener); newLeadBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.LEAD)); popupButtonsControl.addOption(newLeadBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_CASE)) { Button newCaseBtn = new Button(UserUIContext.getMessage(CaseI18nEnum.SINGLE), listener); newCaseBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CASE)); popupButtonsControl.addOption(newCaseBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_TASK)) { Button newTaskBtn = new Button(UserUIContext.getMessage(TaskI18nEnum.SINGLE), listener); newTaskBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.TASK)); popupButtonsControl.addOption(newTaskBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_CALL)) { Button newCallBtn = new Button(UserUIContext.getMessage(CallI18nEnum.SINGLE), listener); newCallBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CALL)); popupButtonsControl.addOption(newCallBtn); } if (UserUIContext.canWrite(RolePermissionCollections.CRM_MEETING)) { Button newMeetingBtn = new Button(UserUIContext.getMessage(MeetingI18nEnum.SINGLE), listener); newMeetingBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.MEETING)); popupButtonsControl.addOption(newMeetingBtn); } if (popupButtonsControl.getComponentCount() > 0) { addPopupMenu.setContent(popupButtonsControl); serviceMenuContainer.with(addPopupMenu).withAlign(addPopupMenu, Alignment.MIDDLE_LEFT); } } return serviceMenuContainer; }