List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout
public VerticalLayout()
From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java
License:Open Source License
protected TimeLogEditView(final V bean) { this.bean = bean; content = new VerticalLayout(); content.setSpacing(true);//from w ww.j av a2 s . c om content.setSizeFull(); this.setContent(content); this.setCaption(AppContext.getMessage(TimeTrackingI18nEnum.DIALOG_LOG_TIME_ENTRY_TITLE)); this.addStyleName("timelog-edit-view"); this.itemTimeLoggingService = ApplicationContextUtil.getSpringBean(ItemTimeLoggingService.class); this.initUI(); this.loadTimeValue(); }
From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java
License:Open Source License
private void initUI() { headerPanel = new HorizontalLayout(); headerPanel.setWidth("100%"); headerPanel.setStyleName("summary-info-panel"); headerPanel.setMargin(new MarginInfo(true, false, true, false)); headerPanel.setHeightUndefined();/*from ww w. ja va2s .c om*/ content.addComponent(headerPanel); constructSpentTimeEntryPanel(); constructRemainTimeEntryPanel(); this.tableItem = new DefaultPagedBeanList<ItemTimeLoggingService, ItemTimeLoggingSearchCriteria, SimpleItemTimeLogging>( ApplicationContextUtil.getSpringBean(ItemTimeLoggingService.class), new TimeLogRowHandler()) { private static final long serialVersionUID = -4549910960891655297L; @Override protected void renderRows() { int i = 0; Date currentDate = new GregorianCalendar(2100, 1, 1).getTime(); for (final SimpleItemTimeLogging item : currentListData) { if (!DateUtils.isSameDay(item.getLogforday(), currentDate)) { Label dateLbl = new Label(AppContext.formatDate(item.getLogforday())); dateLbl.setStyleName("log-day"); listContainer.addComponent(dateLbl); currentDate = item.getLogforday(); } final Component row = getRowDisplayHandler().generateRow(item, i); listContainer.addComponent(row); i++; } } }; this.tableItem.setWidth("100%"); content.addComponent(tableItem); content.setExpandRatio(tableItem, 1.0f); VerticalLayout controlBtns = new VerticalLayout(); controlBtns.setSpacing(true); controlBtns.setWidth("100%"); controlBtns.setMargin(true); controlBtns.addStyleName("edit-btn-layout"); controlBtns.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); Button addNewEntryBtn = new Button(AppContext.getMessage(TimeTrackingI18nEnum.M_DIALOG_ADD_TIME_LOG_ENTRY), new Button.ClickListener() { private static final long serialVersionUID = -2540265040691537699L; @Override public void buttonClick(Button.ClickEvent event) { UI.getCurrent().addWindow(new NewTimeLogEntryWindow()); } }); addNewEntryBtn.setWidth("100%"); controlBtns.addComponent(addNewEntryBtn); Button updateRemainTimeBtn = new Button( AppContext.getMessage(TimeTrackingI18nEnum.M_DIALOG_UPDATE_REMAIN_HOURS), new Button.ClickListener() { private static final long serialVersionUID = 9215577509351959739L; @Override public void buttonClick(Button.ClickEvent event) { UI.getCurrent().addWindow(new UpdateRemainTimeWindow()); } }); updateRemainTimeBtn.setWidth("100%"); controlBtns.addComponent(updateRemainTimeBtn); NavigationBarQuickMenu editBtn = new NavigationBarQuickMenu(); editBtn.setButtonCaption(null); editBtn.setStyleName("edit-btn"); editBtn.setContent(controlBtns); this.setRightComponent(editBtn); }
From source file:com.esofthead.mycollab.mobile.module.project.ui.TimeLogEditView.java
License:Open Source License
private void constructSpentTimeEntryPanel() { final VerticalLayout totalLayout = new VerticalLayout(); totalLayout.setMargin(new MarginInfo(false, true, false, true)); totalLayout.setStyleName("summary-block"); totalLayout.addStyleName("total-time"); totalLayout.setWidth("100%"); final Label lbTimeInstructTotal = new Label( AppContext.getMessage(TimeTrackingI18nEnum.OPT_TOTAL_SPENT_HOURS)); lbTimeInstructTotal.setStyleName("block-label"); totalLayout.addComponent(lbTimeInstructTotal); this.totalSpentTimeLbl = new Label("_"); this.totalSpentTimeLbl.setStyleName("block-value"); this.totalSpentTimeLbl.addStyleName("numberTotal"); totalLayout.addComponent(this.totalSpentTimeLbl); headerPanel.addComponent(totalLayout); }
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. ja v a2s . 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.bug.BugReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createButtonControls() { ProjectPreviewFormControlsGenerator<SimpleBug> formControlsGenerator = new ProjectPreviewFormControlsGenerator<SimpleBug>( this.previewForm); VerticalLayout controlsLayout = formControlsGenerator .createButtonControls(ProjectRolePermissionCollections.BUGS); bugWorkFlowControl = new VerticalLayout(); bugWorkFlowControl.setWidth("100%"); bugWorkFlowControl.setSpacing(true); formControlsGenerator.insertToControlBlock(bugWorkFlowControl); return controlsLayout; }
From source file:com.esofthead.mycollab.mobile.module.project.view.bug.ReOpenView.java
License:Open Source License
private void constructUI() { VerticalLayout contentLayout = new VerticalLayout(); contentLayout.setWidth("100%"); contentLayout.addComponent(this.editForm); final Button reOpenBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_REOPEN), new Button.ClickListener() { @Override/* ww w . ja v a2 s . c o m*/ public void buttonClick(final Button.ClickEvent event) { if (editForm.validateForm()) { ReOpenView.this.bug.setStatus(BugStatus.ReOpened.name()); // Save bug status and assignee final BugService bugService = ApplicationContextUtil.getSpringBean(BugService.class); bugService.updateSelectiveWithSession(ReOpenView.this.bug, AppContext.getUsername()); // Save comment final String commentValue = editForm.commentArea.getValue(); if (commentValue != null && !commentValue.trim().equals("")) { final Comment comment = new Comment(); comment.setComment(commentValue); comment.setCreatedtime(new GregorianCalendar().getTime()); comment.setCreateduser(AppContext.getUsername()); comment.setSaccountid(AppContext.getAccountId()); comment.setType(CommentType.PRJ_BUG.toString()); comment.setTypeid("" + ReOpenView.this.bug.getId()); comment.setExtratypeid(CurrentProjectVariables.getProjectId()); final CommentService commentService = ApplicationContextUtil .getSpringBean(CommentService.class); commentService.saveWithSession(comment, AppContext.getUsername()); } ReOpenView.this.callbackForm.previewItem(bug); EventBusFactory.getInstance().post(new ShellEvent.NavigateBack(this, null)); } } }); reOpenBtn.setStyleName("save-btn"); this.setRightComponent(reOpenBtn); this.setContent(contentLayout); }
From source file:com.esofthead.mycollab.mobile.module.project.view.message.MessageAddViewImpl.java
License:Open Source License
public MessageAddViewImpl() { this.addStyleName("message-add-view"); this.setCaption(AppContext.getMessage(MessageI18nEnum.M_VIEW_ADD_TITLE)); this.content = new CssLayout(); this.content.setStyleName("content-layout"); this.content.setSizeFull(); this.setContent(this.content); VerticalLayout addFormLayout = new VerticalLayout(); addFormLayout.setStyleName("addform-layout"); addFormLayout.setWidth("100%"); subjectField = new TextField(); subjectField.setStyleName("title-field"); subjectField.setWidth("100%"); subjectField.setInputPrompt(AppContext.getMessage(MessageI18nEnum.FORM_TITLE)); addFormLayout.addComponent(subjectField); contentField = new TextArea(); contentField.setStyleName("content-field"); contentField.setWidth("100%"); contentField.setInputPrompt(AppContext.getMessage(MessageI18nEnum.M_FORM_CONTENT_FIELD_PROMPT)); addFormLayout.addComponent(contentField); VerticalComponentGroup bottomRow = new VerticalComponentGroup(); bottomRow.setStyleName("bottom-row"); bottomRow.setWidth("100%"); isStickField = new Switch(AppContext.getMessage(MessageI18nEnum.FORM_IS_STICK), false); bottomRow.addComponent(isStickField); attachment = new MessageAttachmentField(); attachment.setCaption(null);/*ww w . j a va 2 s.c o m*/ bottomRow.addComponent(attachment); this.content.addComponent(addFormLayout); this.content.addComponent(bottomRow); this.saveBtn = new Button(AppContext.getMessage(GenericI18Enum.M_BUTTON_DONE)); this.saveBtn.addStyleName("save-btn"); this.saveBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -2038682412445718948L; @Override public void buttonClick(Button.ClickEvent event) { final SimpleMessage message = new SimpleMessage(); message.setProjectid(CurrentProjectVariables.getProjectId()); message.setPosteddate(new GregorianCalendar().getTime()); if (!subjectField.getValue().toString().trim().equals("")) { message.setTitle(subjectField.getValue()); message.setMessage(contentField.getValue()); message.setPosteduser(AppContext.getUsername()); message.setSaccountid(AppContext.getAccountId()); message.setIsstick(isStickField.getValue()); MessageAddViewImpl.this.fireSaveItem(message); } else { subjectField.addStyleName("errorField"); NotificationUtil.showErrorNotification( AppContext.getMessage(MessageI18nEnum.FORM_TITLE_REQUIRED_ERROR)); } } }); this.setRightComponent(saveBtn); }
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);//from ww w . java 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
public MessageReadViewImpl() { super();//from w ww . j a v a 2s. c om this.addStyleName("message-read-view"); this.setCaption(AppContext.getMessage(MessageI18nEnum.M_VIEW_READ_TITLE)); mainLayout = new VerticalLayout(); mainLayout.setWidth("100%"); this.setContent(mainLayout); }