List of usage examples for com.vaadin.ui Label Label
public Label(String text)
From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java
License:Open Source License
private void constructRemainTimeEntryPanel() { final VerticalLayout updateLayout = new VerticalLayout(); updateLayout.setMargin(new MarginInfo(false, true, false, true)); updateLayout.setStyleName("summary-block"); updateLayout.addStyleName("remain-time"); updateLayout.setWidth("100%"); final Label lbTimeInstructTotal = new Label( AppContext.getMessage(TimeTrackingI18nEnum.OPT_REMAINING_WORK_HOURS)); lbTimeInstructTotal.setStyleName("block-label"); updateLayout.addComponent(lbTimeInstructTotal); this.remainTimeLbl = new Label("_"); this.remainTimeLbl.setStyleName("block-value"); this.remainTimeLbl.addStyleName("numberTotal"); updateLayout.addComponent(this.remainTimeLbl); this.headerPanel.addComponent(updateLayout); }
From source file:com.esofthead.mycollab.mobile.module.project.view.bug.BugFormLayoutFactory.java
License:Open Source License
@Override public ComponentContainer getLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(false);// w w w . j a v a2 s .c o m Label header = new Label(AppContext.getMessage(BugI18nEnum.M_FORM_READ_TITLE)); header.setStyleName("h2"); layout.addComponent(header); this.informationLayout = new GridFormLayoutHelper(1, 12, "100%", "150px", Alignment.TOP_LEFT); this.informationLayout.getLayout().addStyleName("colored-gridlayout"); this.informationLayout.getLayout().setMargin(false); this.informationLayout.getLayout().setWidth("100%"); layout.addComponent(this.informationLayout.getLayout()); layout.setComponentAlignment(this.informationLayout.getLayout(), Alignment.BOTTOM_CENTER); return layout; }
From source file:com.esofthead.mycollab.mobile.module.project.view.message.MessageAttachmentField.java
License:Open Source License
@Override protected void constructUI() { content = new VerticalLayout(); content.setStyleName("attachment-field"); rowWrap = new VerticalLayout(); rowWrap.setWidth("100%"); rowWrap.setStyleName("attachment-row-wrap"); HorizontalLayout compHeader = new HorizontalLayout(); compHeader.setWidth("100%"); compHeader.setStyleName("attachment-field-header"); Label headerLbl = new Label(AppContext.getMessage(GenericI18Enum.M_FORM_ATTACHMENT)); headerLbl.setStyleName("field-caption"); compHeader.addComponent(headerLbl);// w w w . j a v a 2 s . c o m compHeader.setExpandRatio(headerLbl, 1.0f); compHeader.addComponent(attachmentBtn); content.addComponent(compHeader); content.addComponent(rowWrap); }
From source file:com.esofthead.mycollab.mobile.module.project.view.message.MessageReadViewImpl.java
License:Open Source License
@Override public void previewItem(SimpleMessage message) { this.bean = message; mainLayout.removeAllComponents();//from w w w . j av a2 s. co m HorizontalLayout messageBlock = new HorizontalLayout(); messageBlock.setStyleName("message-block"); Image userAvatarImg = UserAvatarControlFactory .createUserAvatarEmbeddedComponent(message.getPostedUserAvatarId(), 32); userAvatarImg.setStyleName("user-avatar"); messageBlock.addComponent(userAvatarImg); CssLayout rightCol = new CssLayout(); rightCol.setWidth("100%"); HorizontalLayout metadataRow = new HorizontalLayout(); metadataRow.setWidth("100%"); metadataRow.setStyleName("metadata-row"); Label userNameLbl = new Label(message.getFullPostedUserName()); userNameLbl.setStyleName("user-name"); metadataRow.addComponent(userNameLbl); metadataRow.setExpandRatio(userNameLbl, 1.0f); Label messageTimePost = new Label( DateTimeUtils.getPrettyDateValue(message.getPosteddate(), AppContext.getUserLocale())); messageTimePost.setStyleName("time-post"); messageTimePost.setWidthUndefined(); metadataRow.addComponent(messageTimePost); rightCol.addComponent(metadataRow); HorizontalLayout titleRow = new HorizontalLayout(); titleRow.setWidth("100%"); titleRow.setStyleName("title-row"); Label messageTitle = new Label(message.getTitle()); messageTitle.setStyleName("message-title"); titleRow.addComponent(messageTitle); titleRow.setExpandRatio(messageTitle, 1.0f); if (message.getCommentsCount() > 0) { Label msgCommentCount = new Label(String.valueOf(message.getCommentsCount())); msgCommentCount.setStyleName("comment-count"); msgCommentCount.setWidthUndefined(); titleRow.addComponent(msgCommentCount); titleRow.addStyleName("has-comment"); titleRow.setComponentAlignment(messageTitle, Alignment.MIDDLE_LEFT); } rightCol.addComponent(titleRow); Label messageContent = new Label( StringUtils.trim(StringUtils.trimHtmlTags(message.getMessage()), 150, true)); messageContent.setStyleName("message-content"); rightCol.addComponent(messageContent); ResourceService attachmentService = ApplicationContextUtil.getSpringBean(ResourceService.class); List<Content> attachments = attachmentService .getContents(AttachmentUtils.getProjectEntityAttachmentPath(AppContext.getAccountId(), message.getProjectid(), AttachmentType.PROJECT_MESSAGE, message.getId())); if (attachments != null && !attachments.isEmpty()) { CssLayout attachmentPanel = new CssLayout(); attachmentPanel.setStyleName("attachment-panel"); attachmentPanel.setWidth("100%"); for (Content attachment : attachments) { attachmentPanel.addComponent(MobileAttachmentUtils.renderAttachmentRow(attachment)); } rightCol.addComponent(attachmentPanel); } messageBlock.addComponent(rightCol); messageBlock.setExpandRatio(rightCol, 1.0f); messageBlock.setWidth("100%"); mainLayout.addComponent(messageBlock); MessageCommentListDisplay commentDisplay = new MessageCommentListDisplay(CommentType.PRJ_MESSAGE, CurrentProjectVariables.getProjectId(), true, true, MessageRelayEmailNotificationAction.class); commentDisplay.loadComments("" + message.getId()); this.setToolbar(commentDisplay.getCommentBox()); mainLayout.addComponent(commentDisplay); }
From source file:com.esofthead.mycollab.mobile.module.project.view.milestone.MilestoneFormLayoutFactory.java
License:Open Source License
@Override public ComponentContainer getLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(false);//from w w w . j ava2 s . c o m Label header = new Label(AppContext.getMessage(MilestoneI18nEnum.M_FORM_READ_TITLE)); header.setStyleName("h2"); layout.addComponent(header); this.informationLayout = new GridFormLayoutHelper(1, 8, "100%", "150px", Alignment.TOP_LEFT); this.informationLayout.getLayout().setWidth("100%"); this.informationLayout.getLayout().addStyleName("colored-gridlayout"); this.informationLayout.getLayout().setMargin(false); layout.addComponent(this.informationLayout.getLayout()); layout.setComponentAlignment(this.informationLayout.getLayout(), Alignment.BOTTOM_CENTER); return layout; }
From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectActivityStreamListDisplay.java
License:Open Source License
@Override protected void renderRows() { int i = 0;/*from w w w. j av a 2s . c om*/ Date currentDate = new GregorianCalendar(2100, 1, 1).getTime(); for (final ProjectActivityStream item : currentListData) { if (!DateUtils.isSameDay(item.getCreatedtime(), currentDate)) { Label dateLbl = new Label(AppContext.formatDate(item.getCreatedtime())); dateLbl.setStyleName("activity-date"); listContainer.addComponent(dateLbl); currentDate = item.getCreatedtime(); } final Component row = getRowDisplayHandler().generateRow(item, i); listContainer.addComponent(row); i++; } }
From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectDashboardViewImpl.java
License:Open Source License
@Override public void displayDashboard() { mainLayout.removeAllComponents();/*ww w . j av a 2 s . c o m*/ SimpleProject currentProject = CurrentProjectVariables.getProject(); VerticalLayout projectInfo = new VerticalLayout(); projectInfo.setStyleName("project-info-layout"); projectInfo.setWidth("100%"); projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER); Label projectIcon = new Label("<span aria-hidden=\"true\" data-icon=\"\"></span>"); projectIcon.setStyleName("project-icon"); projectIcon.setContentMode(ContentMode.HTML); projectIcon.setWidthUndefined(); projectInfo.addComponent(projectIcon); Label projectName = new Label(StringUtils.trim(currentProject.getName(), 50, true)); projectName.setWidth("100%"); projectName.setStyleName("project-name"); projectInfo.addComponent(projectName); GridLayout projectModulesList = new GridLayout(2, 3); projectModulesList.setStyleName("project-modules-layout"); projectModulesList.setWidth("100%"); projectModulesList.setSpacing(true); projectModulesList.setDefaultComponentAlignment(Alignment.TOP_CENTER); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MESSAGE), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MILESTONE), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_TASK), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_BUG), "")); // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_FILE), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_RISK), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_PROBLEM), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_TIME), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_STANDAUP), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_USERS), ""), 0, 2, 1, 2); mainLayout.addComponent(projectInfo); mainLayout.addComponent(projectModulesList); }
From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectLoginViewImpl.java
License:Open Source License
private void initUI() { this.setStyleName("login-view"); this.setSizeFull(); VerticalLayout contentLayout = new VerticalLayout(); contentLayout.setStyleName("content-wrapper"); contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER); contentLayout.setMargin(true);/*from w w w . j av a2s .c o m*/ contentLayout.setSpacing(true); contentLayout.setWidth("320px"); Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png")); contentLayout.addComponent(mainLogo); Label introText = new Label( "MyCollab helps you do all your office jobs on the computers, phones and tablets you use"); introText.setStyleName("intro-text"); contentLayout.addComponent(introText); CssLayout welcomeTextWrapper = new CssLayout(); welcomeTextWrapper.setStyleName("welcometext-wrapper"); welcomeTextWrapper.setWidth("100%"); Label welcomeText = new Label("Login to Projects"); welcomeText.setWidth("150px"); welcomeTextWrapper.addComponent(welcomeText); contentLayout.addComponent(welcomeTextWrapper); final EmailField emailField = new EmailField(); emailField.setWidth("100%"); emailField.setInputPrompt("E-mail Address"); emailField.setStyleName("email-input"); contentLayout.addComponent(emailField); final PasswordField pwdField = new PasswordField(); pwdField.setWidth("100%"); pwdField.setInputPrompt("Password"); pwdField.setStyleName("password-input"); contentLayout.addComponent(pwdField); final CheckBox rememberPassword = new CheckBox(); rememberPassword.setWidth("100%"); rememberPassword.setCaption("Remember password"); rememberPassword.setValue(true); contentLayout.addComponent(rememberPassword); Button signInBtn = new Button("Sign In"); signInBtn.setWidth("100%"); signInBtn.addStyleName(UIConstants.BUTTON_BIG); signInBtn.addStyleName(UIConstants.COLOR_BLUE); signInBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent event) { EventBusFactory.getInstance().post(new ProjectEvent.PlainLogin(this, new String[] { emailField.getValue(), pwdField.getValue(), String.valueOf(rememberPassword.getValue()) })); } }); contentLayout.addComponent(signInBtn); Button createAccountBtn = new Button("Create Account"); createAccountBtn.setWidth("100%"); createAccountBtn.addStyleName(UIConstants.BUTTON_BIG); createAccountBtn.addStyleName(UIConstants.COLOR_GRAY); contentLayout.addComponent(createAccountBtn); this.addComponent(contentLayout); }
From source file:com.esofthead.mycollab.mobile.module.project.view.settings.ProjectMemberEditViewImpl.java
License:Open Source License
private void displayRolePermission(Integer roleId) { permissionGroup.removeAllComponents(); if (roleId != null && roleId > 0) { ProjectRoleService roleService = ApplicationContextUtil.getSpringBean(ProjectRoleService.class); SimpleProjectRole role = roleService.findById(roleId, AppContext.getAccountId()); if (role != null) { final PermissionMap permissionMap = role.getPermissionMap(); for (int i = 0; i < ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length; i++) { final String permissionPath = ProjectRolePermissionCollections.PROJECT_PERMISSIONS[i]; Label permissionLbl = new Label( AppContext.getPermissionCaptionValue(permissionMap, permissionPath)); permissionLbl.setCaption(AppContext.getMessage(RolePermissionI18nEnum.valueOf(permissionPath))); permissionGroup.addComponent(permissionLbl); }//from ww w . j a va2 s . co m } } else { for (int i = 0; i < ProjectRolePermissionCollections.PROJECT_PERMISSIONS.length; i++) { final String permissionPath = ProjectRolePermissionCollections.PROJECT_PERMISSIONS[i]; Label permissionLbl = new Label(AppContext.getMessage(SecurityI18nEnum.ACCESS)); permissionLbl.setCaption(permissionPath); permissionGroup.addComponent(permissionLbl); } } }
From source file:com.esofthead.mycollab.mobile.module.project.view.settings.ProjectMemberFormLayoutFactory.java
License:Open Source License
@Override public ComponentContainer getLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(false);/* www. jav a2s.c o m*/ Label header = new Label(AppContext.getMessage(ProjectMemberI18nEnum.FORM_INFORMATION_SECTION)); header.setStyleName("h2"); layout.addComponent(header); this.informationLayout = new GridFormLayoutHelper(1, 3, "100%", "150px", Alignment.TOP_LEFT); this.informationLayout.getLayout().setWidth("100%"); this.informationLayout.getLayout().addStyleName("colored-gridlayout"); this.informationLayout.getLayout().setMargin(false); layout.addComponent(this.informationLayout.getLayout()); layout.setComponentAlignment(this.informationLayout.getLayout(), Alignment.BOTTOM_CENTER); return layout; }