List of usage examples for com.vaadin.ui CssLayout CssLayout
public CssLayout()
From source file:com.mycollab.module.project.view.settings.ProjectRoleListViewImpl.java
License:Open Source License
private ComponentContainer constructTableActionControls() { CssLayout layoutWrapper = new CssLayout(); layoutWrapper.setWidth("100%"); MHorizontalLayout layout = new MHorizontalLayout(); layoutWrapper.addStyleName(WebThemes.TABLE_ACTION_CONTROLS); layoutWrapper.addComponent(layout);/* ww w . java 2 s .c om*/ selectOptionButton = new SelectionOptionButton(this.tableItem); layout.addComponent(this.selectOptionButton); tableActionControls = new DefaultMassItemActionHandlerContainer(); if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.ROLES)) { tableActionControls.addDeleteActionItem(); } tableActionControls.addDownloadPdfActionItem(); tableActionControls.addDownloadExcelActionItem(); tableActionControls.addDownloadCsvActionItem(); layout.with(this.tableActionControls, this.selectedItemsNumberLabel).withAlign(selectedItemsNumberLabel, Alignment.MIDDLE_LEFT); return layoutWrapper; }
From source file:com.mycollab.module.project.view.settings.ProjectRoleReadViewImpl.java
License:Open Source License
public ProjectRoleReadViewImpl() { withMargin(new MarginInfo(true, false, true, false)); headerText = HeaderWithFontAwesome.h2(FontAwesome.USERS, UserUIContext.getMessage(ProjectRoleI18nEnum.DETAIL)); headerText.setSizeUndefined();// ww w . j av a 2s . c om this.addComponent(constructHeader()); previewForm = initPreviewForm(); ComponentContainer actionControls = createButtonControls(); addHeaderRightContent(actionControls); CssLayout contentWrapper = new CssLayout(); contentWrapper.setWidth("100%"); contentWrapper.setStyleName(WebThemes.CONTENT_WRAPPER); previewLayout = new DefaultReadViewLayout(""); contentWrapper.addComponent(previewLayout); previewLayout.addBody(previewForm); this.addComponent(contentWrapper); }
From source file:com.mycollab.module.project.view.settings.VersionListViewImpl.java
License:Open Source License
private ComponentContainer constructTableActionControls() { final CssLayout layoutWrapper = new CssLayout(); layoutWrapper.setWidth("100%"); MHorizontalLayout layout = new MHorizontalLayout(); layoutWrapper.addStyleName(WebThemes.TABLE_ACTION_CONTROLS); layoutWrapper.addComponent(layout);/*from www . j av a 2 s .c o m*/ this.selectOptionButton = new SelectionOptionButton(this.tableItem); layout.addComponent(this.selectOptionButton); tableActionControls = new DefaultMassItemActionHandlerContainer(); if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.VERSIONS)) { tableActionControls.addDeleteActionItem(); } tableActionControls.addMailActionItem(); tableActionControls.addDownloadPdfActionItem(); tableActionControls.addDownloadExcelActionItem(); tableActionControls.addDownloadCsvActionItem(); layout.with(tableActionControls, selectedItemsNumberLabel).withAlign(selectedItemsNumberLabel, Alignment.MIDDLE_CENTER); return layoutWrapper; }
From source file:com.mycollab.module.project.view.ticket.TicketOverdueWidget.java
License:Open Source License
public TicketOverdueWidget() { super(UserUIContext.getMessage(TicketI18nEnum.VAL_OVERDUE_TICKETS) + " (0)", new CssLayout()); final CheckBox myItemsOnly = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS)); myItemsOnly.addValueChangeListener(valueChangeEvent -> { if (searchCriteria != null) { boolean selectMyItemsOnly = myItemsOnly.getValue(); if (selectMyItemsOnly) { searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername())); } else { searchCriteria.setAssignUser(null); }//from w w w .j a va 2 s.c om ticketOverdueComponent.setSearchCriteria(searchCriteria); } }); this.addHeaderElement(myItemsOnly); ticketOverdueComponent = new TicketOverduePagedList(); bodyContent.addComponent(ticketOverdueComponent); }
From source file:com.mycollab.module.project.view.ticket.TicketRowRenderer.java
License:Open Source License
TicketRowRenderer(final ProjectTicket ticket) { this.ticket = ticket; withMargin(false).withFullWidth().addStyleName(WebThemes.BORDER_LIST_ROW); if (ticket.isTask()) { addStyleName("task"); } else if (ticket.isBug()) { addStyleName("bug"); } else if (ticket.isRisk()) { addStyleName("risk"); }//from w ww. j av a 2 s . co m toggleTicketField = new ToggleTicketSummaryField(ticket); MHorizontalLayout headerLayout = new MHorizontalLayout( ELabel.fontIcon(ProjectAssetsManager.getAsset(ticket.getType())).withWidthUndefined(), toggleTicketField).expand(toggleTicketField).withFullWidth() .withMargin(new MarginInfo(false, true, false, false)); TicketComponentFactory popupFieldFactory = AppContextUtil.getSpringBean(TicketComponentFactory.class); AbstractComponent assigneeField = wrapListenerComponent(popupFieldFactory.createAssigneePopupField(ticket)); headerLayout.with(assigneeField, toggleTicketField).expand(toggleTicketField); CssLayout footer = new CssLayout(); footer.addComponent(popupFieldFactory.createCommentsPopupField(ticket)); footer.addComponent(wrapListenerComponent(popupFieldFactory.createPriorityPopupField(ticket))); footer.addComponent(popupFieldFactory.createFollowersPopupField(ticket)); footer.addComponent(wrapListenerComponent(popupFieldFactory.createStatusPopupField(ticket))); footer.addComponent(wrapListenerComponent(popupFieldFactory.createStartDatePopupField(ticket))); footer.addComponent(wrapListenerComponent(popupFieldFactory.createEndDatePopupField(ticket))); footer.addComponent(wrapListenerComponent(popupFieldFactory.createDueDatePopupField(ticket))); if (!SiteConfiguration.isCommunityEdition()) { footer.addComponent(popupFieldFactory.createBillableHoursPopupField(ticket)); footer.addComponent(popupFieldFactory.createNonBillableHoursPopupField(ticket)); } this.with(headerLayout, footer); }
From source file:com.mycollab.module.project.view.user.ProjectActivityStreamPagedList.java
License:Open Source License
@Override protected void doSearch() { totalCount = projectActivityStreamService.getTotalActivityStream( ((BasicSearchRequest<ActivityStreamSearchCriteria>) searchRequest).getSearchCriteria()); totalPage = (totalCount - 1) / searchRequest.getNumberOfItems() + 1; if (searchRequest.getCurrentPage() > totalPage) { searchRequest.setCurrentPage(totalPage); }// w ww . j a v a 2 s.co m if (totalPage > 1) { if (controlBarWrapper != null) { removeComponent(controlBarWrapper); } this.addComponent(createPageControls()); } else { if (getComponentCount() == 2) { removeComponent(getComponent(1)); } } List<ProjectActivityStream> currentListData = projectActivityStreamService .getProjectActivityStreams((BasicSearchRequest<ActivityStreamSearchCriteria>) searchRequest); this.listContainer.removeAllComponents(); Date currentDate = new GregorianCalendar(2100, 1, 1).getTime(); CssLayout currentFeedBlock = new CssLayout(); AuditLogRegistry auditLogRegistry = AppContextUtil.getSpringBean(AuditLogRegistry.class); try { for (ProjectActivityStream activityStream : currentListData) { if (ProjectTypeConstants.PAGE.equals(activityStream.getType())) { ProjectPageService pageService = AppContextUtil.getSpringBean(ProjectPageService.class); Page page = pageService.getPage(activityStream.getTypeid(), UserUIContext.getUsername()); if (page != null) { activityStream.setNamefield(page.getSubject()); } } Date itemCreatedDate = activityStream.getCreatedtime(); if (!DateUtils.isSameDay(currentDate, itemCreatedDate)) { currentFeedBlock = new CssLayout(); currentFeedBlock.setStyleName("feed-block"); feedBlocksPut(currentDate, itemCreatedDate, currentFeedBlock); currentDate = itemCreatedDate; } StringBuilder content = new StringBuilder(); String itemType = ProjectLocalizationTypeMap.getType(activityStream.getType()); String assigneeParam = buildAssigneeValue(activityStream); String itemParam = buildItemValue(activityStream); if (ActivityStreamConstants.ACTION_CREATE.equals(activityStream.getAction())) { content.append( UserUIContext.getMessage(ProjectCommonI18nEnum.FEED_USER_ACTIVITY_CREATE_ACTION_TITLE, assigneeParam, itemType, itemParam)); } else if (ActivityStreamConstants.ACTION_UPDATE.equals(activityStream.getAction())) { content.append( UserUIContext.getMessage(ProjectCommonI18nEnum.FEED_USER_ACTIVITY_UPDATE_ACTION_TITLE, assigneeParam, itemType, itemParam)); if (activityStream.getAssoAuditLog() != null) { content.append(auditLogRegistry.generatorDetailChangeOfActivity(activityStream)); } } else if (ActivityStreamConstants.ACTION_COMMENT.equals(activityStream.getAction())) { content.append( UserUIContext.getMessage(ProjectCommonI18nEnum.FEED_USER_ACTIVITY_COMMENT_ACTION_TITLE, assigneeParam, itemType, itemParam)); if (activityStream.getAssoAuditLog() != null) { content.append("<p><ul><li>\"").append( StringUtils.trimHtmlTags(activityStream.getAssoAuditLog().getChangeset(), 200)) .append("\"</li></ul></p>"); } } else if (ActivityStreamConstants.ACTION_DELETE.equals(activityStream.getAction())) { content.append( UserUIContext.getMessage(ProjectCommonI18nEnum.FEED_USER_ACTIVITY_DELETE_ACTION_TITLE, assigneeParam, itemType, itemParam)); } Label actionLbl = new Label(content.toString(), ContentMode.HTML); CssLayout streamWrapper = new CssLayout(); streamWrapper.setWidth("100%"); streamWrapper.addStyleName("stream-wrapper"); streamWrapper.addComponent(actionLbl); currentFeedBlock.addComponent(streamWrapper); } } catch (Exception e) { throw new MyCollabException(e); } }
From source file:com.mycollab.module.project.view.user.ProjectMembersWidget.java
License:Open Source License
public ProjectMembersWidget() { super("", new CssLayout()); final MButton sortBtn = new MButton().withIcon(FontAwesome.SORT_ALPHA_ASC) .withStyleName(WebThemes.BUTTON_ICON_ONLY); sortBtn.addClickListener(clickEvent -> { sortAsc = !sortAsc;/*from w ww.j ava2 s. com*/ if (sortAsc) { sortBtn.setIcon(FontAwesome.SORT_ALPHA_ASC); searchCriteria.setOrderFields(Collections .singletonList(new SearchCriteria.OrderField("memberFullName", SearchCriteria.ASC))); } else { sortBtn.setIcon(FontAwesome.SORT_ALPHA_DESC); searchCriteria.setOrderFields(Collections .singletonList(new SearchCriteria.OrderField("memberFullName", SearchCriteria.DESC))); } memberList.setSearchCriteria(searchCriteria); setTitle(UserUIContext.getMessage(ProjectCommonI18nEnum.WIDGET_MEMBERS_TITLE, memberList.getTotalCount())); }); addHeaderElement(sortBtn); final SearchTextField searchTextField = new SearchTextField() { @Override public void doSearch(String value) { searchCriteria.setMemberFullName(StringSearchField.and(value)); showMembers(); } @Override public void emptySearch() { searchCriteria.setMemberFullName(null); showMembers(); } }; searchTextField.addStyleName(ValoTheme.TEXTFIELD_SMALL); addHeaderElement(searchTextField); MButton inviteMemberBtn = new MButton(UserUIContext.getMessage(ProjectMemberI18nEnum.BUTTON_NEW_INVITEE), clickEvent -> EventBusFactory.getInstance() .post(new ProjectMemberEvent.GotoInviteMembers(this, null))).withIcon(FontAwesome.PLUS) .withStyleName(WebThemes.BUTTON_ACTION).withVisible( CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS)); addHeaderElement(inviteMemberBtn); memberList = new DefaultBeanPagedList<>(AppContextUtil.getSpringBean(ProjectMemberService.class), new MemberRowDisplayHandler(), 7); bodyContent.addComponent(memberList); }
From source file:com.mycollab.module.project.view.user.ProjectOverdueTicketsWidget.java
License:Open Source License
public ProjectOverdueTicketsWidget() { super(String.format("%s (0)", UserUIContext.getMessage(TicketI18nEnum.VAL_OVERDUE_TICKETS)), new CssLayout()); this.setWidth("100%"); final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS)); myItemsSelection.addValueChangeListener(valueChangeEvent -> { boolean isMyItemsOption = myItemsSelection.getValue(); if (isMyItemsOption) { searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername())); } else {//ww w.j a v a 2 s .com searchCriteria.setAssignUser(null); } updateSearchResult(); }); ticketList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowDisplayHandler(), 10) { @Override protected String stringWhenEmptyList() { return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_OVERDUE_TICKET); } }; this.addHeaderElement(myItemsSelection); bodyContent.addComponent(ticketList); }
From source file:com.mycollab.module.project.view.user.ProjectUnresolvedTicketsWidget.java
License:Open Source License
public ProjectUnresolvedTicketsWidget() { super("", new CssLayout()); this.setWidth("100%"); final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS)); myItemsSelection.addValueChangeListener(valueChangeEvent -> { boolean isMyItemsOption = myItemsSelection.getValue(); if (isMyItemsOption) { searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername())); } else {/*from ww w.j a v a 2 s . c om*/ searchCriteria.setAssignUser(null); } updateSearchResult(); }); taskList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowDisplayHandler(), 10) { @Override protected String stringWhenEmptyList() { return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET); } }; addHeaderElement(myItemsSelection); bodyContent.addComponent(taskList); }
From source file:com.mycollab.module.project.view.user.TaskStatusComponent.java
License:Open Source License
public TaskStatusComponent() { super(AppContext.getMessage(ProjectCommonI18nEnum.WIDGET_OVERDUE_ASSIGNMENTS_TITLE, 0), new CssLayout()); final CheckBox myItemsOnly = new CheckBox(AppContext.getMessage(GenericI18Enum.OPT_MY_ITEMS)); myItemsOnly.addValueChangeListener(new Property.ValueChangeListener() { @Override/* w ww. jav a 2 s .c o m*/ public void valueChange(Property.ValueChangeEvent valueChangeEvent) { if (searchCriteria != null) { boolean selectMyItemsOnly = myItemsOnly.getValue(); if (selectMyItemsOnly) { searchCriteria.setAssignUser(StringSearchField.and(AppContext.getUsername())); } else { searchCriteria.setAssignUser(null); } taskComponents.setSearchCriteria(searchCriteria); } } }); this.addHeaderElement(myItemsOnly); taskComponents = new TaskStatusPagedList(); bodyContent.addComponent(taskComponents); }