List of usage examples for com.vaadin.ui Alignment MIDDLE_RIGHT
Alignment MIDDLE_RIGHT
To view the source code for com.vaadin.ui Alignment MIDDLE_RIGHT.
Click Source Link
From source file:com.mycollab.module.crm.view.opportunity.OpportunityContactListComp.java
License:Open Source License
@Override protected Component generateTopControls() { MHorizontalLayout controlsBtnWrap = new MHorizontalLayout().withSpacing(false).withFullWidth(); MHorizontalLayout notesWrap = new MHorizontalLayout( new ELabel(UserUIContext.getMessage(GenericI18Enum.OPT_NOTE)).withWidthUndefined()).withFullWidth(); CssLayout noteBlock = new CssLayout(); noteBlock.setWidth("100%"); noteBlock.setStyleName("list-note-block"); for (OptionI18nEnum.OpportunityContactRole role : CrmDataTypeFactory.getOpportunityContactRoleList()) { ELabel note = new ELabel(UserUIContext.getMessage(role)) .withStyleName("note-label", colormap.get(role.name())).withWidthUndefined() .withHeightUndefined();//www . j a v a 2 s .c o m noteBlock.addComponent(note); } notesWrap.with(noteBlock).expand(noteBlock); controlsBtnWrap.addComponent(notesWrap); if (UserUIContext.canWrite(RolePermissionCollections.CRM_CONTACT)) { final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined(); controlsBtn.addStyleName(WebThemes.BUTTON_ACTION); controlsBtn.setCaption(UserUIContext.getMessage(ContactI18nEnum.OPT_ADD_EDIT_CONTACT_ROLES)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(event -> EventBusFactory.getInstance() .post(new OpportunityEvent.GotoContactRoleEdit(this, opportunity))); final Button selectBtn = new Button(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT), clickEvent -> { OpportunityContactSelectionWindow contactsWindow = new OpportunityContactSelectionWindow( OpportunityContactListComp.this); ContactSearchCriteria criteria = new ContactSearchCriteria(); criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId())); UI.getCurrent().addWindow(contactsWindow); contactsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); }); selectBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CONTACT)); OptionPopupContent buttonControlLayout = new OptionPopupContent(); buttonControlLayout.addOption(selectBtn); controlsBtn.setContent(buttonControlLayout); controlsBtnWrap.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT); } return controlsBtnWrap; }
From source file:com.mycollab.module.crm.view.opportunity.OpportunityLeadListComp.java
License:Open Source License
@Override protected Component generateTopControls() { VerticalLayout controlsBtnWrap = new VerticalLayout(); controlsBtnWrap.setWidth("100%"); if (UserUIContext.canWrite(RolePermissionCollections.CRM_LEAD)) { final SplitButton controlsBtn = new SplitButton(); controlsBtn.addStyleName(WebThemes.BUTTON_ACTION); controlsBtn.setCaption(UserUIContext.getMessage(LeadI18nEnum.NEW)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(event -> fireNewRelatedItem("")); MButton selectBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT), clickEvent -> { final OpportunityLeadSelectionWindow leadsWindow = new OpportunityLeadSelectionWindow( OpportunityLeadListComp.this); final LeadSearchCriteria criteria = new LeadSearchCriteria(); criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId())); UI.getCurrent().addWindow(leadsWindow); leadsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); }).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.LEAD)); OptionPopupContent buttonControlLayout = new OptionPopupContent(); buttonControlLayout.addOption(selectBtn); controlsBtn.setContent(buttonControlLayout); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); }/*from ww w. ja v a 2 s .c o m*/ return controlsBtnWrap; }
From source file:com.mycollab.module.file.view.AbstractResourceMovingWindow.java
License:Open Source License
private void constructBody() { MVerticalLayout contentLayout = new MVerticalLayout(); new Restrain(contentLayout).setMaxHeight("600px"); this.setContent(contentLayout); folderTree = new Tree(); folderTree.setMultiSelect(false);//from www. ja v a2 s . c o m folderTree.setSelectable(true); folderTree.setImmediate(true); folderTree.setSizeFull(); folderTree.addExpandListener(expandEvent -> { final Folder expandFolder = (Folder) expandEvent.getItemId(); // load externalResource if currentExpandFolder is rootFolder if (baseFolder.getPath().equals(expandFolder.getPath())) { List<ExternalDrive> externalDrives = externalDriveService .getExternalDrivesOfUser(UserUIContext.getUsername()); for (ExternalDrive externalDrive : externalDrives) { ExternalFolder externalMapFolder = new ExternalFolder("/"); externalMapFolder.setStorageName(externalDrive.getStoragename()); externalMapFolder.setExternalDrive(externalDrive); externalMapFolder.setName(externalDrive.getFoldername()); Calendar cal = GregorianCalendar.getInstance(); cal.setTime(externalDrive.getCreatedtime()); externalMapFolder.setCreated(cal); expandFolder.addChild(externalMapFolder); folderTree.addItem(externalMapFolder); folderTree.setItemIcon(externalMapFolder, FontAwesome.DROPBOX); folderTree.setItemCaption(externalMapFolder, externalMapFolder.getName()); folderTree.setParent(externalMapFolder, expandFolder); } } if (expandFolder instanceof ExternalFolder) { List<ExternalFolder> subFolders = externalResourceService .getSubFolders(((ExternalFolder) expandFolder).getExternalDrive(), expandFolder.getPath()); for (final Folder subFolder : subFolders) { expandFolder.addChild(subFolder); folderTree.addItem(subFolder); folderTree.setItemIcon(subFolder, FontAwesome.DROPBOX); folderTree.setItemCaption(subFolder, subFolder.getName()); folderTree.setParent(subFolder, expandFolder); } } else { final List<Folder> subFolders = resourceService.getSubFolders(expandFolder.getPath()); folderTree.setItemIcon(expandFolder, FontAwesome.FOLDER_OPEN); if (subFolders != null) { for (final Folder subFolder : subFolders) { String subFolderName = subFolder.getName(); if (!subFolderName.startsWith(".")) { expandFolder.addChild(subFolder); folderTree.addItem(subFolder); folderTree.setItemIcon(subFolder, FontAwesome.FOLDER); folderTree.setItemCaption(subFolder, subFolderName); folderTree.setParent(subFolder, expandFolder); } } } } }); folderTree.addCollapseListener(new Tree.CollapseListener() { private static final long serialVersionUID = 1L; @Override public void nodeCollapse(final CollapseEvent event) { final Folder collapseFolder = (Folder) event.getItemId(); if (collapseFolder instanceof ExternalFolder) { folderTree.setItemIcon(collapseFolder, FontAwesome.DROPBOX); } else { folderTree.setItemIcon(collapseFolder, FontAwesome.FOLDER); } collapseFolder.getChilds().forEach(this::recursiveRemoveSubItem); } private void recursiveRemoveSubItem(Folder collapseFolder) { List<Folder> childFolders = collapseFolder.getChilds(); if (childFolders.size() > 0) { childFolders.forEach(this::recursiveRemoveSubItem); folderTree.removeItem(collapseFolder); } else { folderTree.removeItem(collapseFolder); } } }); folderTree.addItemClickListener(itemClickEvent -> baseFolder = (Folder) itemClickEvent.getItemId()); CssLayout treeWrapper = new CssLayout(folderTree); treeWrapper.setSizeFull(); contentLayout.addComponent(treeWrapper); displayFiles(); MButton moveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_MOVE), clickEvent -> { if (!CollectionUtils.isEmpty(movedResources)) { boolean checkingFail = false; for (Resource res : movedResources) { try { resourceMover.moveResource(res, baseFolder, UserUIContext.getUsername(), MyCollabUI.getAccountId()); } catch (Exception e) { checkingFail = true; LOG.error("Error", e); } } close(); displayAfterMoveSuccess(baseFolder, checkingFail); } }).withIcon(FontAwesome.ARROWS).withStyleName(WebThemes.BUTTON_ACTION); MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION); MHorizontalLayout controlGroupBtnLayout = new MHorizontalLayout(cancelBtn, moveBtn); contentLayout.with(controlGroupBtnLayout).withAlign(controlGroupBtnLayout, Alignment.MIDDLE_RIGHT); }
From source file:com.mycollab.module.file.view.components.AbstractResourceMovingWindow.java
License:Open Source License
private void constructBody() { MVerticalLayout contentLayout = new MVerticalLayout(); new Restrain(contentLayout).setMaxHeight("600px"); this.setContent(contentLayout); folderTree = new Tree(); folderTree.setMultiSelect(false);/* w w w.j a v a 2s .c o m*/ folderTree.setSelectable(true); folderTree.setImmediate(true); folderTree.setSizeFull(); folderTree.addExpandListener(new Tree.ExpandListener() { private static final long serialVersionUID = 1L; @Override public void nodeExpand(final ExpandEvent event) { final Folder expandFolder = (Folder) event.getItemId(); // load externalResource if currentExpandFolder is rootFolder if (baseFolder.getPath().equals(expandFolder.getPath())) { List<ExternalDrive> externalDrives = externalDriveService .getExternalDrivesOfUser(AppContext.getUsername()); for (ExternalDrive externalDrive : externalDrives) { ExternalFolder externalMapFolder = new ExternalFolder("/"); externalMapFolder.setStorageName(externalDrive.getStoragename()); externalMapFolder.setExternalDrive(externalDrive); externalMapFolder.setName(externalDrive.getFoldername()); Calendar cal = GregorianCalendar.getInstance(); cal.setTime(externalDrive.getCreatedtime()); externalMapFolder.setCreated(cal); expandFolder.addChild(externalMapFolder); folderTree.addItem(externalMapFolder); folderTree.setItemIcon(externalMapFolder, FontAwesome.DROPBOX); folderTree.setItemCaption(externalMapFolder, externalMapFolder.getName()); folderTree.setParent(externalMapFolder, expandFolder); } } if (expandFolder instanceof ExternalFolder) { List<ExternalFolder> subFolders = externalResourceService.getSubFolders( ((ExternalFolder) expandFolder).getExternalDrive(), expandFolder.getPath()); for (final Folder subFolder : subFolders) { expandFolder.addChild(subFolder); folderTree.addItem(subFolder); folderTree.setItemIcon(subFolder, FontAwesome.DROPBOX); folderTree.setItemCaption(subFolder, subFolder.getName()); folderTree.setParent(subFolder, expandFolder); } } else { final List<Folder> subFolders = resourceService.getSubFolders(expandFolder.getPath()); folderTree.setItemIcon(expandFolder, FontAwesome.FOLDER_OPEN); if (subFolders != null) { for (final Folder subFolder : subFolders) { String subFolderName = subFolder.getName(); if (!subFolderName.startsWith(".")) { expandFolder.addChild(subFolder); folderTree.addItem(subFolder); folderTree.setItemIcon(subFolder, FontAwesome.FOLDER); folderTree.setItemCaption(subFolder, subFolderName); folderTree.setParent(subFolder, expandFolder); } } } } } }); folderTree.addCollapseListener(new Tree.CollapseListener() { private static final long serialVersionUID = 1L; @Override public void nodeCollapse(final CollapseEvent event) { final Folder collapseFolder = (Folder) event.getItemId(); if (collapseFolder instanceof ExternalFolder) { folderTree.setItemIcon(collapseFolder, FontAwesome.DROPBOX); } else { folderTree.setItemIcon(collapseFolder, FontAwesome.FOLDER); } for (Folder folder : collapseFolder.getChilds()) { recursiveRemoveSubItem(folder); } } private void recursiveRemoveSubItem(Folder collapseFolder) { List<Folder> childFolders = collapseFolder.getChilds(); if (childFolders.size() > 0) { for (Folder subFolder : childFolders) { recursiveRemoveSubItem(subFolder); } folderTree.removeItem(collapseFolder); } else { folderTree.removeItem(collapseFolder); } } }); folderTree.addItemClickListener(new ItemClickEvent.ItemClickListener() { private static final long serialVersionUID = 1L; @Override public void itemClick(final ItemClickEvent event) { baseFolder = (Folder) event.getItemId(); } }); CssLayout treeWrapper = new CssLayout(folderTree); treeWrapper.setSizeFull(); contentLayout.addComponent(treeWrapper); displayFiles(); MHorizontalLayout controlGroupBtnLayout = new MHorizontalLayout(); Button moveBtn = new Button("Move", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { if (!CollectionUtils.isEmpty(movedResources)) { boolean checkingFail = false; for (Resource res : movedResources) { try { resourceMover.moveResource(res, baseFolder, AppContext.getUsername(), AppContext.getAccountId()); } catch (Exception e) { checkingFail = true; LOG.error("Error", e); } } close(); displayAfterMoveSuccess(baseFolder, checkingFail); } } }); moveBtn.setIcon(FontAwesome.ARROWS); moveBtn.addStyleName(UIConstants.BUTTON_ACTION); Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL), new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { close(); } }); cancelBtn.addStyleName(UIConstants.BUTTON_OPTION); controlGroupBtnLayout.with(cancelBtn, moveBtn); contentLayout.with(controlGroupBtnLayout).withAlign(controlGroupBtnLayout, Alignment.MIDDLE_RIGHT); }
From source file:com.mycollab.module.file.view.FileDownloadWindow.java
License:Open Source License
private void constructBody() { final MVerticalLayout layout = new MVerticalLayout().withFullWidth(); CssLayout iconWrapper = new CssLayout(); final ELabel iconEmbed = ELabel.fontIcon(FileAssetsUtil.getFileIconResource(content.getName())); iconEmbed.addStyleName("icon-48px"); iconWrapper.addComponent(iconEmbed); layout.with(iconWrapper).withAlign(iconWrapper, Alignment.MIDDLE_CENTER); final GridFormLayoutHelper inforLayout = GridFormLayoutHelper.defaultFormLayoutHelper(1, 4); if (content.getDescription() != null) { final Label descLbl = new Label(); if (!content.getDescription().equals("")) { descLbl.setData(content.getDescription()); } else {//w w w. ja v a 2 s. co m descLbl.setValue(" "); descLbl.setContentMode(ContentMode.HTML); } inforLayout.addComponent(descLbl, UserUIContext.getMessage(GenericI18Enum.FORM_DESCRIPTION), 0, 0); } UserService userService = AppContextUtil.getSpringBean(UserService.class); SimpleUser user = userService.findUserByUserNameInAccount(content.getCreatedUser(), MyCollabUI.getAccountId()); if (user == null) { inforLayout.addComponent( new UserLink(UserUIContext.getUsername(), UserUIContext.getUserAvatarId(), UserUIContext.getUserDisplayName()), UserUIContext.getMessage(GenericI18Enum.OPT_CREATED_BY), 0, 1); } else { inforLayout.addComponent(new UserLink(user.getUsername(), user.getAvatarid(), user.getDisplayName()), UserUIContext.getMessage(GenericI18Enum.OPT_CREATED_BY), 0, 1); } final Label size = new Label(FileUtils.getVolumeDisplay(content.getSize())); inforLayout.addComponent(size, UserUIContext.getMessage(FileI18nEnum.OPT_SIZE), 0, 2); ELabel dateCreate = new ELabel().prettyDateTime(content.getCreated().getTime()); inforLayout.addComponent(dateCreate, UserUIContext.getMessage(GenericI18Enum.FORM_CREATED_TIME), 0, 3); layout.addComponent(inforLayout.getLayout()); MButton downloadBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DOWNLOAD)) .withIcon(FontAwesome.DOWNLOAD).withStyleName(WebThemes.BUTTON_ACTION); List<Resource> resources = new ArrayList<>(); resources.add(content); StreamResource downloadResource = StreamDownloadResourceUtil.getStreamResourceSupportExtDrive(resources); FileDownloader fileDownloader = new FileDownloader(downloadResource); fileDownloader.extend(downloadBtn); MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION); final MHorizontalLayout buttonControls = new MHorizontalLayout(cancelBtn, downloadBtn); layout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT); this.setContent(layout); }
From source file:com.mycollab.module.project.ui.components.CommentRowDisplayHandler.java
License:Open Source License
@Override public Component generateRow(IBeanList<SimpleComment> host, final SimpleComment comment, int rowIndex) { final MHorizontalLayout layout = new MHorizontalLayout().withMargin(new MarginInfo(true, true, true, false)) .withFullWidth();//from w w w . j a v a 2 s. c om ProjectMemberBlock memberBlock = new ProjectMemberBlock(comment.getCreateduser(), comment.getOwnerAvatarId(), comment.getOwnerFullName()); layout.addComponent(memberBlock); MVerticalLayout rowLayout = new MVerticalLayout().withFullWidth() .withStyleName(WebThemes.MESSAGE_CONTAINER); MHorizontalLayout messageHeader = new MHorizontalLayout().withMargin(false).withFullWidth(); messageHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ELabel timePostLbl = ELabel .html(UserUIContext.getMessage(GenericI18Enum.EXT_ADDED_COMMENT, comment.getOwnerFullName(), UserUIContext.formatPrettyTime(comment.getCreatedtime()))) .withDescription(UserUIContext.formatDateTime(comment.getCreatedtime())); timePostLbl.setStyleName(UIConstants.META_INFO); if (hasDeletePermission(comment)) { MButton msgDeleteBtn = new MButton(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_ICON_ONLY) .withListener(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()); ((BeanList) host).removeRow(layout); } }); }); 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().withSpacing(false).withFullWidth(); AttachmentDisplayComponent attachmentDisplay = new AttachmentDisplayComponent(attachments); attachmentDisplay.setWidth("100%"); messageFooter.with(attachmentDisplay).withAlign(attachmentDisplay, Alignment.MIDDLE_RIGHT); rowLayout.addComponent(messageFooter); } layout.with(rowLayout).expand(rowLayout); return layout; }
From source file:com.mycollab.module.project.ui.components.ProjectActivityComponent.java
License:Open Source License
public ProjectActivityComponent(String type, Integer extraTypeId) { withMargin(false).withStyleName("activity-comp"); this.type = type; this.groupFormatter = AuditLogRegistry.getFieldGroupFormatterOfType(type); headerLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.OPT_CHANGE_HISTORY, 0)); 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();/*from w ww .ja v a 2 s. c o m*/ }); MHorizontalLayout headerPanel = new MHorizontalLayout().withMargin(true) .withStyleName(WebThemes.FORM_SECTION).withFullWidth().with(headerLbl, sortDirection) .withAlign(headerLbl, Alignment.MIDDLE_LEFT).withAlign(sortDirection, Alignment.MIDDLE_RIGHT); commentBox = new ProjectCommentInput(this, type, extraTypeId); activityBox = new MVerticalLayout().withMargin(new MMarginInfo(true, true, true, false)); this.with(headerPanel, commentBox, activityBox); commentService = AppContextUtil.getSpringBean(CommentService.class); auditLogService = AppContextUtil.getSpringBean(AuditLogService.class); }
From source file:com.mycollab.module.project.view.AbstractProjectPageView.java
License:Open Source License
public void addHeaderRightContent(Component c) { header.with(c).withAlign(c, Alignment.MIDDLE_RIGHT); }
From source file:com.mycollab.module.project.view.FollowingTicketViewImpl.java
License:Open Source License
@Override public void initContent() { removeAllComponents();/* ww w . ja v a2 s . c o m*/ MHorizontalLayout header = new MHorizontalLayout().withFullWidth(); ELabel layoutHeader = ELabel .h2(FontAwesome.EYE.getHtml() + " " + UserUIContext.getMessage(FollowerI18nEnum.OPT_MY_FOLLOWING_TICKETS, 0)) .withWidthUndefined(); Button exportBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT), clickEvent -> exportButtonControl.setPopupVisible(true)); exportButtonControl = new SplitButton(exportBtn); exportButtonControl.addStyleName(WebThemes.BUTTON_OPTION); exportButtonControl.setIcon(FontAwesome.EXTERNAL_LINK); OptionPopupContent popupButtonsControl = new OptionPopupContent(); exportButtonControl.setContent(popupButtonsControl); Button exportPdfBtn = new Button(UserUIContext.getMessage(FileI18nEnum.PDF)); FileDownloader pdfDownloader = new FileDownloader(constructStreamResource(ReportExportType.PDF)); pdfDownloader.extend(exportPdfBtn); exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O); popupButtonsControl.addOption(exportPdfBtn); Button exportExcelBtn = new Button(UserUIContext.getMessage(FileI18nEnum.EXCEL)); FileDownloader excelDownloader = new FileDownloader(constructStreamResource(ReportExportType.EXCEL)); excelDownloader.extend(exportExcelBtn); exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O); popupButtonsControl.addOption(exportExcelBtn); header.with(layoutHeader, exportButtonControl).withAlign(layoutHeader, Alignment.MIDDLE_LEFT) .withAlign(exportButtonControl, Alignment.MIDDLE_RIGHT); this.addComponent(layoutHeader); searchPanel = new FollowingTicketSearchPanel(); this.addComponent(searchPanel); this.ticketTable = new FollowingTicketTableDisplay(); this.ticketTable.setMargin(new MarginInfo(true, false, false, false)); this.addComponent(this.ticketTable); }
From source file:com.mycollab.module.project.view.milestone.AllMilestoneTimelineWidget.java
License:Open Source License
public void display() { this.withMargin(new MarginInfo(false, false, true, false)).withStyleName("tm-container").withFullWidth(); MHorizontalLayout headerLayout = new MHorizontalLayout() .withMargin(new MarginInfo(false, true, false, true)).withStyleName(WebThemes.PANEL_HEADER); headerLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ELabel titleLbl = ELabel.h3(UserUIContext.getMessage(MilestoneI18nEnum.OPT_TIMELINE)); final CheckBox includeNoDateSet = new CheckBox(UserUIContext.getMessage(DayI18nEnum.OPT_NO_DATE_SET)); includeNoDateSet.setValue(false);/*from w w w .ja v a 2 s. com*/ final CheckBox includeClosedMilestone = new CheckBox(UserUIContext.getMessage(MilestoneStatus.Closed)); includeClosedMilestone.setValue(false); includeNoDateSet.addValueChangeListener(valueChangeEvent -> displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue())); includeClosedMilestone .addValueChangeListener(valueChangeEvent -> displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue())); headerLayout.with(titleLbl, includeNoDateSet, includeClosedMilestone).expand(titleLbl) .withAlign(includeNoDateSet, Alignment.MIDDLE_RIGHT) .withAlign(includeClosedMilestone, Alignment.MIDDLE_RIGHT); MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria(); UserDashboardView userDashboardView = UIUtils.getRoot(this, UserDashboardView.class); searchCriteria.setProjectIds(new SetSearchField<>(userDashboardView.getInvolvedProjectKeys())); searchCriteria.setOrderFields( Collections.singletonList(new SearchCriteria.OrderField(Milestone.Field.enddate.name(), "ASC"))); MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class); milestones = milestoneService.findPageableListByCriteria(new BasicSearchRequest<>(searchCriteria)); this.addComponent(headerLayout); timelineContainer = new CssLayout(); timelineContainer.setWidth("100%"); this.addComponent(timelineContainer); timelineContainer.addStyleName("tm-wrapper"); displayTimelines(false, false); }