List of usage examples for com.vaadin.ui Label Label
public Label()
From source file:com.cms.view.ContractTemplateListView.java
private void buildSearchLayout() { searchLayout = new GridLayout(); searchLayout.setCaption(MakeURL.makeURLForGrid(BundleUtils.getString("caption.search.info"))); searchLayout.setCaptionAsHtml(true); searchLayout.setImmediate(false);//from w ww . j a v a2s .com searchLayout.setWidth("100.0%"); searchLayout.setHeight("-1px"); searchLayout.setMargin(true); searchLayout.setSpacing(true); searchLayout.setColumns(4); searchLayout.setRows(4); searchLayout.setStyleName("custom-feildset"); lblCode = new Label(); lblCode.setImmediate(false); lblCode.setWidth("100.0%"); lblCode.setHeight("-1px"); lblCode.setValue(BundleUtils.getString("label.ContractTemplateList.code")); searchLayout.addComponent(lblCode, 0, 0); txtCode = new TextField(); txtCode.setImmediate(false); txtCode.setWidth("100.0%"); txtCode.setHeight("-1px"); searchLayout.addComponent(txtCode, 1, 0); lblName = new Label(); lblName.setImmediate(false); lblName.setWidth("100.0%"); lblName.setHeight("-1px"); lblName.setValue(BundleUtils.getString("label.ContractTemplateList.name")); searchLayout.addComponent(lblName, 2, 0); txtName = new TextField(); txtName.setImmediate(false); txtName.setWidth("100.0%"); txtName.setHeight("-1px"); searchLayout.addComponent(txtName, 3, 0); lblPathFile = new Label(); lblPathFile.setImmediate(false); lblPathFile.setWidth("100.0%"); lblPathFile.setHeight("-1px"); lblPathFile.setValue(BundleUtils.getString("label.ContractTemplateList.pathFile")); // searchLayout.addComponent(lblPathFile, 0, 1); txtPathFile = new TextField(); txtPathFile.setImmediate(false); txtPathFile.setWidth("100.0%"); txtPathFile.setHeight("-1px"); // searchLayout.addComponent(txtPathFile, 1, 1); lblCreatedDate = new Label(); lblCreatedDate.setImmediate(false); lblCreatedDate.setWidth("100.0%"); lblCreatedDate.setHeight("-1px"); lblCreatedDate.setValue(BundleUtils.getString("label.ContractTemplateList.createdDate")); // searchLayout.addComponent(lblCreatedDate, 0, 1); popCreatedDate = new PopupDateField(); popCreatedDate.setImmediate(false); popCreatedDate.setWidth("100.0%"); popCreatedDate.setHeight("-1px"); // searchLayout.addComponent(popCreatedDate, 3, 1); lblLastUpdatedDate = new Label(); lblLastUpdatedDate.setImmediate(false); lblLastUpdatedDate.setWidth("100.0%"); lblLastUpdatedDate.setHeight("-1px"); lblLastUpdatedDate.setValue(BundleUtils.getString("label.ContractTemplateList.lastUpdatedDate")); // searchLayout.addComponent(lblLastUpdatedDate, 0, 2); popLastUpdatedDate = new PopupDateField(); popLastUpdatedDate.setImmediate(false); popLastUpdatedDate.setWidth("100.0%"); popLastUpdatedDate.setHeight("-1px"); // searchLayout.addComponent(popLastUpdatedDate, 1, 2); lblService = new Label(); lblService.setImmediate(false); lblService.setWidth("100.0%"); lblService.setHeight("-1px"); lblService.setValue(BundleUtils.getString("label.ContractTemplateList.service")); searchLayout.addComponent(lblService, 0, 1); cboService = new ComboBox(); cboService.setImmediate(false); cboService.setWidth("100.0%"); cboService.setHeight("-1px"); searchLayout.addComponent(cboService, 1, 1); lblProvider = new Label(); lblProvider.setImmediate(false); lblProvider.setWidth("100.0%"); lblProvider.setHeight("-1px"); lblProvider.setValue(BundleUtils.getString("label.ContractTemplateList.provider")); searchLayout.addComponent(lblProvider, 2, 1); cboProvider = new ComboBox(); cboProvider.setImmediate(false); cboProvider.setWidth("100.0%"); cboProvider.setHeight("-1px"); searchLayout.addComponent(cboProvider, 3, 1); lblType = new Label(); lblType.setImmediate(false); lblType.setWidth("100.0%"); lblType.setHeight("-1px"); lblType.setValue(BundleUtils.getString("label.ContractTemplateList.type")); searchLayout.addComponent(lblType, 0, 2); cboType = new ComboBox(); cboType.setImmediate(false); cboType.setWidth("100.0%"); cboType.setHeight("-1px"); searchLayout.addComponent(cboType, 1, 2); lblStatus = new Label(); lblStatus.setImmediate(false); lblStatus.setWidth("100.0%"); lblStatus.setHeight("-1px"); lblStatus.setValue(BundleUtils.getString("label.ContractTemplateList.status")); searchLayout.addComponent(lblStatus, 2, 2); cbxStatus = new ComboBox(); cbxStatus.setImmediate(false); cbxStatus.setWidth("100.0%"); cbxStatus.setHeight("-1px"); searchLayout.addComponent(cbxStatus, 3, 2); }
From source file:com.cms.view.ObjectsView.java
public void buildSearchLayout() { searchLayout = new GridLayout(); searchLayout.setCaption(MakeURL.makeURLForGrid(BundleUtils.getString("caption.search.info"))); searchLayout.setCaptionAsHtml(true); searchLayout.setImmediate(true);// w w w .java2s.c om searchLayout.setWidth("100.0%"); searchLayout.setHeight("-1px"); searchLayout.setMargin(true); searchLayout.setSpacing(true); searchLayout.setColumns(4); searchLayout.setRows(3); searchLayout.setStyleName("custom-feildset"); lblCode = new Label(); lblCode.setImmediate(true); lblCode.setWidth("100.0%"); lblCode.setHeight("-1px"); lblCode.setValue(BundleUtils.getString("label.Objects.code")); searchLayout.addComponent(lblCode, 0, 0); txtCode = new TextField(); txtCode.setImmediate(true); txtCode.setWidth("100.0%"); txtCode.setHeight("-1px"); searchLayout.addComponent(txtCode, 1, 0); lblName = new Label(); lblName.setImmediate(true); lblName.setWidth("100.0%"); lblName.setHeight("-1px"); lblName.setValue(BundleUtils.getString("label.Objects.name")); searchLayout.addComponent(lblName, 2, 0); txtName = new TextField(); txtName.setImmediate(true); txtName.setWidth("100.0%"); txtName.setHeight("-1px"); searchLayout.addComponent(txtName, 3, 0); lblUrl = new Label(); lblUrl.setImmediate(true); lblUrl.setWidth("100.0%"); lblUrl.setHeight("-1px"); lblUrl.setValue(BundleUtils.getString("label.Objects.url")); searchLayout.addComponent(lblUrl, 0, 1); txtUrl = new TextField(); txtUrl.setImmediate(true); txtUrl.setWidth("100.0%"); txtUrl.setHeight("-1px"); searchLayout.addComponent(txtUrl, 1, 1); lblDescription = new Label(); lblDescription.setImmediate(true); lblDescription.setWidth("100.0%"); lblDescription.setHeight("-1px"); lblDescription.setValue(BundleUtils.getString("label.Objects.description")); searchLayout.addComponent(lblDescription, 2, 1); txtDescription = new TextArea(); txtDescription.setImmediate(true); txtDescription.setWidth("100.0%"); txtDescription.setHeight("-1px"); searchLayout.addComponent(txtDescription, 3, 1); lblObjectType = new Label(); lblObjectType.setImmediate(true); lblObjectType.setWidth("100.0%"); lblObjectType.setHeight("-1px"); lblObjectType.setValue(BundleUtils.getString("label.Objects.objectType")); searchLayout.addComponent(lblObjectType, 0, 2); txtObjectType = new TextField(); txtObjectType.setImmediate(true); txtObjectType.setWidth("100.0%"); txtObjectType.setHeight("-1px"); searchLayout.addComponent(txtObjectType, 1, 2); lblStatus = new Label(); lblStatus.setImmediate(true); lblStatus.setWidth("100.0%"); lblStatus.setHeight("-1px"); lblStatus.setValue(BundleUtils.getString("label.Objects.status")); searchLayout.addComponent(lblStatus, 2, 2); cbxStatus = new ComboBox(); cbxStatus.setImmediate(true); cbxStatus.setWidth("100.0%"); cbxStatus.setHeight("-1px"); searchLayout.addComponent(cbxStatus, 3, 2); }
From source file:com.cms.view.PriceInfoView.java
public void buildSearchLayout() { searchLayout = new GridLayout(); searchLayout.setCaption(MakeURL.makeURLForGrid(BundleUtils.getString("caption.search.info"))); searchLayout.setCaptionAsHtml(true); searchLayout.setImmediate(false);/*from w w w . j a v a 2s. c o m*/ searchLayout.setWidth("100.0%"); searchLayout.setHeight("-1px"); searchLayout.setMargin(true); searchLayout.setSpacing(true); searchLayout.setColumns(4); searchLayout.setRows(4); searchLayout.setStyleName("custom-feildset"); lblCode = new Label(); lblCode.setImmediate(false); lblCode.setWidth("100.0%"); lblCode.setHeight("-1px"); lblCode.setValue(BundleUtils.getString("label.PriceInfo.code")); searchLayout.addComponent(lblCode, 0, 0); txtCode = new TextField(); txtCode.setImmediate(false); txtCode.setWidth("100.0%"); txtCode.setHeight("-1px"); searchLayout.addComponent(txtCode, 1, 0); lblName = new Label(); lblName.setImmediate(false); lblName.setWidth("100.0%"); lblName.setHeight("-1px"); lblName.setValue(BundleUtils.getString("label.PriceInfo.name")); searchLayout.addComponent(lblName, 2, 0); txtName = new TextField(); txtName.setImmediate(false); txtName.setWidth("100.0%"); txtName.setHeight("-1px"); searchLayout.addComponent(txtName, 3, 0); lblPrice = new Label(); lblPrice.setImmediate(false); lblPrice.setWidth("100.0%"); lblPrice.setHeight("-1px"); lblPrice.setValue(BundleUtils.getString("label.PriceInfo.price")); searchLayout.addComponent(lblPrice, 0, 1); txtPrice = new TextField(); txtPrice.setImmediate(false); txtPrice.setWidth("100.0%"); txtPrice.setHeight("-1px"); searchLayout.addComponent(txtPrice, 1, 1); lblTokenPrice = new Label(); lblTokenPrice.setImmediate(false); lblTokenPrice.setWidth("100.0%"); lblTokenPrice.setHeight("-1px"); lblTokenPrice.setValue(BundleUtils.getString("label.PriceInfo.tokenPrice")); searchLayout.addComponent(lblTokenPrice, 2, 1); txtTokenPrice = new TextField(); txtTokenPrice.setImmediate(false); txtTokenPrice.setWidth("100.0%"); txtTokenPrice.setHeight("-1px"); searchLayout.addComponent(txtTokenPrice, 3, 1); lblProvider = new Label(); lblProvider.setImmediate(false); lblProvider.setWidth("100.0%"); lblProvider.setHeight("-1px"); lblProvider.setValue(BundleUtils.getString("label.PriceInfo.provider")); searchLayout.addComponent(lblProvider, 0, 2); cbxProvider = new ComboBox(); cbxProvider.setImmediate(false); cbxProvider.setWidth("100.0%"); cbxProvider.setHeight("-1px"); searchLayout.addComponent(cbxProvider, 1, 2); lblType = new Label(); lblType.setImmediate(false); lblType.setWidth("100.0%"); lblType.setHeight("-1px"); lblType.setValue(BundleUtils.getString("label.PriceInfo.type")); searchLayout.addComponent(lblType, 2, 2); cbxType = new ComboBox(); cbxType.setImmediate(false); cbxType.setWidth("100.0%"); cbxType.setHeight("-1px"); searchLayout.addComponent(cbxType, 3, 2); lblStatus = new Label(); lblStatus.setImmediate(false); lblStatus.setWidth("100.0%"); lblStatus.setHeight("-1px"); lblStatus.setValue(BundleUtils.getString("label.PriceInfo.status")); searchLayout.addComponent(lblStatus, 0, 3); cbxStatus = new ComboBox(); cbxStatus.setImmediate(false); cbxStatus.setWidth("100.0%"); cbxStatus.setHeight("-1px"); searchLayout.addComponent(cbxStatus, 1, 3); }
From source file:com.cms.view.ServicesView.java
public void buildSearchLayout() { searchLayout = new GridLayout(); searchLayout.setCaption(MakeURL.makeURLForGrid(BundleUtils.getString("caption.search.info"))); searchLayout.setCaptionAsHtml(true); searchLayout.setImmediate(false);/*from ww w.ja v a 2 s . c o m*/ searchLayout.setWidth("100.0%"); searchLayout.setHeight("-1px"); searchLayout.setMargin(true); searchLayout.setSpacing(true); searchLayout.setColumns(4); searchLayout.setRows(10); searchLayout.setStyleName("custom-feildset"); lblCode = new Label(); lblCode.setImmediate(false); lblCode.setWidth("100.0%"); lblCode.setHeight("-1px"); lblCode.setValue(BundleUtils.getString("label.Services.code")); searchLayout.addComponent(lblCode, 0, 0); txtCode = new TextField(); txtCode.setImmediate(false); txtCode.setWidth("100.0%"); txtCode.setHeight("-1px"); searchLayout.addComponent(txtCode, 1, 0); lblDescription = new Label(); lblDescription.setImmediate(false); lblDescription.setWidth("100.0%"); lblDescription.setHeight("-1px"); lblDescription.setValue(BundleUtils.getString("label.Services.description")); searchLayout.addComponent(lblDescription, 2, 0); txtDescription = new TextArea(); txtDescription.setImmediate(false); txtDescription.setWidth("100.0%"); txtDescription.setHeight("-1px"); searchLayout.addComponent(txtDescription, 3, 0); lblExpiryDate = new Label(); lblExpiryDate.setImmediate(false); lblExpiryDate.setWidth("100.0%"); lblExpiryDate.setHeight("-1px"); lblExpiryDate.setValue(BundleUtils.getString("label.Services.expiryDate")); searchLayout.addComponent(lblExpiryDate, 0, 1); popExpiryDate = new PopupDateField(); popExpiryDate.setImmediate(false); popExpiryDate.setWidth("100.0%"); popExpiryDate.setHeight("-1px"); searchLayout.addComponent(popExpiryDate, 1, 1); lblIssueDate = new Label(); lblIssueDate.setImmediate(false); lblIssueDate.setWidth("100.0%"); lblIssueDate.setHeight("-1px"); lblIssueDate.setValue(BundleUtils.getString("label.Services.issueDate")); searchLayout.addComponent(lblIssueDate, 2, 1); popIssueDate = new PopupDateField(); popIssueDate.setImmediate(false); popIssueDate.setWidth("100.0%"); popIssueDate.setHeight("-1px"); searchLayout.addComponent(popIssueDate, 3, 1); lblName = new Label(); lblName.setImmediate(false); lblName.setWidth("100.0%"); lblName.setHeight("-1px"); lblName.setValue(BundleUtils.getString("label.Services.name")); searchLayout.addComponent(lblName, 0, 2); txtName = new TextField(); txtName.setImmediate(false); txtName.setWidth("100.0%"); txtName.setHeight("-1px"); searchLayout.addComponent(txtName, 1, 2); lblServiceGroup = new Label(); lblServiceGroup.setImmediate(false); lblServiceGroup.setWidth("100.0%"); lblServiceGroup.setHeight("-1px"); lblServiceGroup.setValue(BundleUtils.getString("label.Services.serviceGroup")); searchLayout.addComponent(lblServiceGroup, 2, 2); txtServiceGroup = new TextField(); txtServiceGroup.setImmediate(false); txtServiceGroup.setWidth("100.0%"); txtServiceGroup.setHeight("-1px"); searchLayout.addComponent(txtServiceGroup, 3, 2); lblStatus = new Label(); lblStatus.setImmediate(false); lblStatus.setWidth("100.0%"); lblStatus.setHeight("-1px"); lblStatus.setValue(BundleUtils.getString("label.Services.status")); searchLayout.addComponent(lblStatus, 0, 3); cbxStatus = new ComboBox(); cbxStatus.setImmediate(false); cbxStatus.setWidth("100.0%"); cbxStatus.setHeight("-1px"); searchLayout.addComponent(cbxStatus, 1, 3); lblType = new Label(); lblType.setImmediate(false); lblType.setWidth("100.0%"); lblType.setHeight("-1px"); lblType.setValue(BundleUtils.getString("label.Services.type")); searchLayout.addComponent(lblType, 2, 3); cbxType = new ComboBox(); cbxType.setImmediate(false); cbxType.setWidth("100.0%"); cbxType.setHeight("-1px"); searchLayout.addComponent(cbxType, 3, 3); }
From source file:com.cms.view.TaxAuthorityView.java
public void buildSearchLayout() { searchLayout = new GridLayout(); searchLayout.setCaption(MakeURL.makeURLForGrid(BundleUtils.getString("caption.search.info"))); searchLayout.setCaptionAsHtml(true); searchLayout.setImmediate(true);//from w ww . j av a 2s.co m searchLayout.setWidth("100.0%"); searchLayout.setHeight("-1px"); searchLayout.setMargin(true); searchLayout.setSpacing(true); searchLayout.setColumns(4); searchLayout.setRows(3); searchLayout.setStyleName("custom-feildset"); // lblId = new Label(); // lblId.setImmediate(true); // lblId.setWidth("100.0%"); // lblId.setHeight("-1px"); // lblId.setValue(BundleUtils.getString("label.TaxAuthority.id")); // searchLayout.addComponent(lblId, 0, 0); // txtId = new TextField(); // txtId.setImmediate(true); // txtId.setWidth("100.0%"); // txtId.setHeight("-1px"); // searchLayout.addComponent(txtId, 1, 0); lblMaCqt = new Label(); lblMaCqt.setImmediate(true); lblMaCqt.setWidth("100.0%"); lblMaCqt.setHeight("-1px"); lblMaCqt.setValue(BundleUtils.getString("label.TaxAuthority.maCqt")); searchLayout.addComponent(lblMaCqt, 0, 0); txtMaCqt = new TextField(); txtMaCqt.setImmediate(true); txtMaCqt.setWidth("100.0%"); txtMaCqt.setHeight("-1px"); searchLayout.addComponent(txtMaCqt, 1, 0); lblTenCqt = new Label(); lblTenCqt.setImmediate(true); lblTenCqt.setWidth("100.0%"); lblTenCqt.setHeight("-1px"); lblTenCqt.setValue(BundleUtils.getString("label.TaxAuthority.tenCqt")); searchLayout.addComponent(lblTenCqt, 2, 0); txtTenCqt = new TextField(); txtTenCqt.setImmediate(true); txtTenCqt.setWidth("100.0%"); txtTenCqt.setHeight("-1px"); searchLayout.addComponent(txtTenCqt, 3, 0); lblMaTinh = new Label(); lblMaTinh.setImmediate(true); lblMaTinh.setWidth("100.0%"); lblMaTinh.setHeight("-1px"); lblMaTinh.setValue(BundleUtils.getString("label.TaxAuthority.maTinh")); searchLayout.addComponent(lblMaTinh, 0, 1); cboMaTinh = new ComboBox(); cboMaTinh.setImmediate(true); cboMaTinh.setWidth("100.0%"); cboMaTinh.setHeight("-1px"); searchLayout.addComponent(cboMaTinh, 1, 1); lblMaQuanHuyen = new Label(); lblMaQuanHuyen.setImmediate(true); lblMaQuanHuyen.setWidth("100.0%"); lblMaQuanHuyen.setHeight("-1px"); lblMaQuanHuyen.setValue(BundleUtils.getString("label.TaxAuthority.maQuanHuyen")); searchLayout.addComponent(lblMaQuanHuyen, 2, 1); txtMaQuanHuyen = new TextField(); txtMaQuanHuyen.setImmediate(true); txtMaQuanHuyen.setWidth("100.0%"); txtMaQuanHuyen.setHeight("-1px"); searchLayout.addComponent(txtMaQuanHuyen, 3, 1); lblStatus = new Label(); lblStatus.setImmediate(true); lblStatus.setWidth("100.0%"); lblStatus.setHeight("-1px"); lblStatus.setValue(BundleUtils.getString("label.TaxAuthority.status")); searchLayout.addComponent(lblStatus, 0, 2); cboStatus = new ComboBox(); cboStatus.setImmediate(true); cboStatus.setWidth("100.0%"); cboStatus.setHeight("-1px"); searchLayout.addComponent(cboStatus, 1, 2); }
From source file:com.esofthead.mycollab.module.crm.view.activity.ActivityCalendarViewImpl.java
License:Open Source License
private void initContent() { MHorizontalLayout contentWrapper = new MHorizontalLayout().withSpacing(false).withWidth("100%"); this.addComponent(contentWrapper); /* Content cheat */ MVerticalLayout mainContent = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, true)) .withWidth("100%").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)) .withWidth("100%").withStyleName(UIConstants.HEADER_VIEW); actionPanel.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); Label headerText = new CrmViewHeader(CrmTypeConstants.ACTIVITY, "Calendar"); headerText.setStyleName(UIConstants.HEADER_TEXT); actionPanel.with(headerText).expand(headerText); mainContent.addComponent(actionPanel); this.dateHdr = new Label(); this.dateHdr.setSizeUndefined(); this.dateHdr.setStyleName("h2"); mainContent.addComponent(this.dateHdr); mainContent.setComponentAlignment(this.dateHdr, Alignment.MIDDLE_CENTER); toggleViewBtn = new PopupButton("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("Monthly", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/* w w w . java 2 s .co m*/ public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(monthViewBtn.getCaption()); calendarComponent.switchToMonthView(new Date(), true); datePicker.selectDate(new Date()); monthViewBtn.addStyleName("selected-style"); initLabelCaption(); } }); monthViewBtn.setStyleName("link"); popupLayout.addComponent(monthViewBtn); weekViewBtn = new Button("Weekly", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(weekViewBtn.getCaption()); calendarComponent.switchToWeekView(new Date()); datePicker.selectWeek(new Date()); } }); weekViewBtn.setStyleName("link"); popupLayout.addComponent(weekViewBtn); dailyViewBtn = new Button("Daily", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { toggleViewBtn.setPopupVisible(false); toggleViewBtn.setCaption(dailyViewBtn.getCaption()); Date currentDate = new Date(); datePicker.selectDate(currentDate); calendarComponent.switchToDateView(currentDate); } }); dailyViewBtn.setStyleName("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); VerticalLayout actionBtnLayout = new VerticalLayout(); actionBtnLayout.setMargin(true); actionBtnLayout.setSpacing(true); actionBtnLayout.setWidth("150px"); 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 Event")) { EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null)); } } }; ButtonLink todoBtn = new ButtonLink("New Task", listener); actionBtnLayout.addComponent(todoBtn); todoBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.TASK)); todoBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_TASK)); Button callBtn = new ButtonLink("New Call", listener); actionBtnLayout.addComponent(callBtn); callBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CALL)); callBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CALL)); ButtonLink meetingBtn = new ButtonLink("New Meeting", listener); actionBtnLayout.addComponent(meetingBtn); meetingBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.MEETING)); meetingBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_MEETING)); calendarActionBtn.setContent(actionBtnLayout); ButtonGroup viewSwitcher = new ButtonGroup(); Button calendarViewBtn = new Button("Calendar"); calendarViewBtn.setStyleName("selected"); calendarViewBtn.addStyleName(UIConstants.THEME_GREEN_LINK); viewSwitcher.addButton(calendarViewBtn); Button activityListBtn = new Button("Activities", new Button.ClickListener() { private static final long serialVersionUID = 2156576556541398934L; @Override public void buttonClick(ClickEvent evt) { ActivitySearchCriteria criteria = new ActivitySearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); EventBusFactory.getInstance().post(new ActivityEvent.GotoTodoList(this, null)); } }); activityListBtn.addStyleName(UIConstants.THEME_GREEN_LINK); 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("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.esofthead.mycollab.module.crm.view.activity.ActivityTableDisplay.java
License:Open Source License
public ActivityTableDisplay(TableViewField requireColumn, List<TableViewField> displayColumns) { super(ApplicationContextUtil.getSpringBean(EventService.class), SimpleActivity.class, requireColumn, displayColumns);// www.j a v a2s . c om this.addGeneratedColumn("selected", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public Object generateCell(final Table source, final Object itemId, Object columnId) { final SimpleActivity simpleEvent = ActivityTableDisplay.this.getBeanByIndex(itemId); final CheckBoxDecor cb = new CheckBoxDecor("", simpleEvent.isSelected()); cb.setImmediate(true); cb.addValueChangeListener(new Property.ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { ActivityTableDisplay.this.fireSelectItemEvent(simpleEvent); } }); simpleEvent.setExtraData(cb); return cb; } }); this.addGeneratedColumn("startDate", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(Table source, Object itemId, Object columnId) { final SimpleActivity event = ActivityTableDisplay.this.getBeanByIndex(itemId); Label l = new Label(); l.setValue(AppContext.formatDateTime(event.getStartDate())); return l; } }); this.addGeneratedColumn("endDate", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(Table source, Object itemId, Object columnId) { final SimpleActivity event = ActivityTableDisplay.this.getBeanByIndex(itemId); Label l = new Label(); l.setValue(AppContext.formatDateTime(event.getEndDate())); return l; } }); this.addGeneratedColumn("subject", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(Table source, final Object itemId, Object columnId) { final SimpleActivity simpleEvent = ActivityTableDisplay.this.getBeanByIndex(itemId); final LabelLink b = new LabelLink(simpleEvent.getSubject(), CrmLinkBuilder .generateActivityPreviewLinkFull(simpleEvent.getEventType(), simpleEvent.getId())); FontAwesome iconLink = CrmAssetsManager.getAsset(simpleEvent.getEventType()); b.setIconLink(iconLink); if (simpleEvent.isCompleted()) { b.addStyleName(UIConstants.LINK_COMPLETED); } else if (simpleEvent.isOverdue()) { b.addStyleName(UIConstants.LINK_OVERDUE); } b.setDescription(generateToolTip(simpleEvent)); return b; } }); }
From source file:com.esofthead.mycollab.module.crm.view.cases.CaseTableDisplay.java
License:Open Source License
public CaseTableDisplay(String viewId, TableViewField requiredColumn, List<TableViewField> displayColumns) { super(ApplicationContextUtil.getSpringBean(CaseService.class), SimpleCase.class, viewId, requiredColumn, displayColumns);// w w w .j a va 2 s . com this.addGeneratedColumn("selected", new ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public Object generateCell(final Table source, final Object itemId, Object columnId) { final SimpleCase cases = CaseTableDisplay.this.getBeanByIndex(itemId); final CheckBoxDecor cb = new CheckBoxDecor("", cases.isSelected()); cb.setImmediate(true); cb.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { CaseTableDisplay.this.fireSelectItemEvent(cases); } }); cases.setExtraData(cb); return cb; } }); this.addGeneratedColumn("subject", new ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public Object generateCell(Table source, Object itemId, Object columnId) { final SimpleCase cases = CaseTableDisplay.this.getBeanByIndex(itemId); LabelLink b = new LabelLink(cases.getSubject(), CrmLinkBuilder.generateCasePreviewLinkFull(cases.getId())); if (cases.isCompleted()) { b.addStyleName(UIConstants.LINK_COMPLETED); } b.setDescription(CrmTooltipGenerator.generateTooltipCases(AppContext.getUserLocale(), cases, AppContext.getSiteUrl(), AppContext.getTimezone())); return b; } }); this.addGeneratedColumn("accountName", new ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public Object generateCell(Table source, Object itemId, Object columnId) { final SimpleCase cases = CaseTableDisplay.this.getBeanByIndex(itemId); return new LabelLink(cases.getAccountName(), CrmLinkBuilder.generateAccountPreviewLinkFull(cases.getAccountid())); } }); this.addGeneratedColumn("assignUserFullName", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(Table source, final Object itemId, Object columnId) { final SimpleCase cases = CaseTableDisplay.this.getBeanByIndex(itemId); return new UserLink(cases.getAssignuser(), cases.getAssignUserAvatarId(), cases.getAssignUserFullName()); } }); this.addGeneratedColumn("createdtime", new ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(Table source, Object itemId, Object columnId) { final SimpleCase cases = CaseTableDisplay.this.getBeanByIndex(itemId); Label l = new Label(); l.setValue(AppContext.formatDateTime(cases.getCreatedtime())); return l; } }); this.setWidth("100%"); }
From source file:com.esofthead.mycollab.module.crm.view.opportunity.OpportunityContactTableDisplay.java
License:Open Source License
public OpportunityContactTableDisplay(List<TableViewField> displayColumns) { super(ApplicationContextUtil.getSpringBean(ContactOpportunityService.class), SimpleContactOpportunityRel.class, displayColumns); addGeneratedColumn("contactName", new ColumnGenerator() { private static final long serialVersionUID = 1L; @Override/*from www . java2 s . c o m*/ public Object generateCell(final Table source, final Object itemId, final Object columnId) { final SimpleContact contact = OpportunityContactTableDisplay.this.getBeanByIndex(itemId); LabelLink b = new LabelLink(contact.getContactName(), CrmLinkBuilder.generateContactPreviewLinkFull(contact.getId())); b.setDescription(CrmTooltipGenerator.generateToolTipContact(AppContext.getUserLocale(), contact, AppContext.getSiteUrl(), AppContext.getTimezone())); return b; } }); addGeneratedColumn("email", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(final Table source, final Object itemId, final Object columnId) { final SimpleContact contact = OpportunityContactTableDisplay.this.getBeanByIndex(itemId); return new EmailLink(contact.getEmail()); } }); addGeneratedColumn("accountName", new Table.ColumnGenerator() { private static final long serialVersionUID = 1L; @Override public com.vaadin.ui.Component generateCell(final Table source, final Object itemId, final Object columnId) { final SimpleContact contact = OpportunityContactTableDisplay.this.getBeanByIndex(itemId); if (contact.getAccountName() != null) { return new LabelLink(contact.getAccountName(), CrmLinkBuilder.generateAccountPreviewLinkFull(contact.getAccountid())); } else { return new Label(); } } }); }
From source file:com.esofthead.mycollab.module.file.view.components.FileDownloadWindow.java
License:Open Source License
private void constructBody() { final MVerticalLayout layout = new MVerticalLayout(); final Embedded iconEmbed = new Embedded(); iconEmbed.setSource(MyCollabResource.newResource("icons/page_white.png")); layout.with(iconEmbed).withAlign(iconEmbed, Alignment.MIDDLE_CENTER); final GridFormLayoutHelper info = new GridFormLayoutHelper(1, 4, "100%", "80px", Alignment.TOP_LEFT); info.getLayout().setWidth("100%"); info.getLayout().setMargin(new MarginInfo(false, true, false, true)); info.getLayout().setSpacing(false);/*from w ww .j a v a2 s . c o m*/ if (this.content.getDescription() != null) { final Label desvalue = new Label(); if (!this.content.getDescription().equals("")) { desvalue.setData(this.content.getDescription()); } else { desvalue.setValue(" "); desvalue.setContentMode(ContentMode.HTML); } info.addComponent(desvalue, "Description", 0, 0); } final Label author = new Label(this.content.getCreatedBy()); info.addComponent(author, "Created by", 0, 1); final Label size = new Label(ResourceUtils.getVolumeDisplay(this.content.getSize())); info.addComponent(size, "Size", 0, 2); final Label dateCreate = new Label(AppContext.formatDate(this.content.getCreated().getTime())); info.addComponent(dateCreate, "Date created", 0, 3); layout.addComponent(info.getLayout()); final MHorizontalLayout buttonControls = new MHorizontalLayout(); buttonControls.setSpacing(true); buttonControls.setMargin(new MarginInfo(true, false, true, false)); final Button downloadBtn = new Button("Download"); List<Resource> resources = new ArrayList<Resource>(); resources.add(content); StreamResource downloadResource = StreamDownloadResourceUtil.getStreamResourceSupportExtDrive(resources); FileDownloader fileDownloader = new FileDownloader(downloadResource); fileDownloader.extend(downloadBtn); downloadBtn.addStyleName(UIConstants.THEME_GREEN_LINK); buttonControls.with(downloadBtn).withAlign(downloadBtn, Alignment.MIDDLE_CENTER); final Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL), new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { FileDownloadWindow.this.close(); } }); cancelBtn.addStyleName(UIConstants.THEME_GRAY_LINK); buttonControls.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER); layout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_CENTER); this.setContent(layout); }