List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout
public VerticalLayout()
From source file:com.esofthead.mycollab.module.crm.view.cases.CaseContactListComp.java
License:Open Source License
@Override protected Component generateTopControls() { VerticalLayout controlsBtnWrap = new VerticalLayout(); controlsBtnWrap.setWidth("100%"); final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined();//from w ww . ja va 2 s .com controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CONTACT)); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption(AppContext.getMessage(ContactI18nEnum.BUTTON_NEW_CONTACT)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1L; @Override public void splitButtonClick(SplitButton.SplitButtonClickEvent event) { fireNewRelatedItem(""); } }); Button selectBtn = new Button("Select from existing contacts", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent event) { CaseContactSelectionWindow contactsWindow = new CaseContactSelectionWindow( CaseContactListComp.this); ContactSearchCriteria criteria = new ContactSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(contactsWindow); contactsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlsLayout = new VerticalLayout(); buttonControlsLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlsLayout); controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CONTACT)); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlsBtnWrap; }
From source file:com.esofthead.mycollab.module.crm.view.cases.CaseListNoItemView.java
License:Open Source License
public CaseListNoItemView() { VerticalLayout layout = new VerticalLayout(); layout.addStyleName("case-noitem"); layout.setWidth("800px"); layout.setSpacing(true);/*from ww w.j a va2 s .c o m*/ layout.setDefaultComponentAlignment(Alignment.TOP_CENTER); layout.setMargin(true); Image image = new Image(null, MyCollabResource.newResource("icons/48/crm/case.png")); layout.addComponent(image); Label title = new Label(AppContext.getMessage(CaseI18nEnum.VIEW_NO_ITEM_TITLE)); title.addStyleName("h2"); title.setWidthUndefined(); layout.addComponent(title); Label contact = new Label(AppContext.getMessage(CaseI18nEnum.VIEW_NO_ITEM_HINT)); contact.setWidthUndefined(); layout.addComponent(contact); Button btCreateContact = new Button(AppContext.getMessage(CaseI18nEnum.BUTTON_NEW_CASE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance().post(new CaseEvent.GotoAdd(this, null)); } }); HorizontalLayout links = new HorizontalLayout(); links.addComponent(btCreateContact); btCreateContact.addStyleName(UIConstants.THEME_GREEN_LINK); /* * Label or = new Label("Or"); or.setStyleName("h2"); * links.addComponent(or); * * Button btImportContact = new Button("Import Cases", new * Button.ClickListener() { private static final long serialVersionUID = * 1L; * * @Override public void buttonClick(ClickEvent arg0) { * UI.getCurrent().addWindow(new CaseImportWindow()); } }); * * btImportContact.addStyleName(UIConstants.THEME_GRAY_LINK); * * * links.addComponent(btImportContact); */ links.setSpacing(true); layout.addComponent(links); this.addComponent(layout); this.setComponentAlignment(layout, Alignment.TOP_CENTER); }
From source file:com.esofthead.mycollab.module.crm.view.contact.ContactListNoItemView.java
License:Open Source License
public ContactListNoItemView() { VerticalLayout layout = new VerticalLayout(); layout.addStyleName("case-noitem"); layout.setWidth("800px"); layout.setSpacing(true);// w w w .j a v a 2 s.com layout.setDefaultComponentAlignment(Alignment.TOP_CENTER); layout.setMargin(true); Image image = new Image(null, MyCollabResource.newResource("icons/48/crm/contact.png")); layout.addComponent(image); Label title = new Label(AppContext.getMessage(ContactI18nEnum.VIEW_NO_ITEM_TITLE)); title.addStyleName("h2"); title.setWidthUndefined(); layout.addComponent(title); Label contact = new Label(AppContext.getMessage(ContactI18nEnum.VIEW_NO_ITEM_HINT)); contact.setWidthUndefined(); layout.addComponent(contact); Button btCreateContact = new Button(AppContext.getMessage(ContactI18nEnum.BUTTON_NEW_CONTACT), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance().post(new ContactEvent.GotoAdd(this, null)); } }); HorizontalLayout links = new HorizontalLayout(); links.addComponent(btCreateContact); btCreateContact.addStyleName(UIConstants.THEME_GREEN_LINK); /* * Label or = new Label("Or"); or.setStyleName("h2"); * links.addComponent(or); * * Button btImportContact = new Button("Import Contacts", new * Button.ClickListener() { private static final long serialVersionUID = * 1L; * * @Override public void buttonClick(ClickEvent arg0) { * UI.getCurrent().addWindow(new CaseImportWindow()); } }); * * btImportContact.addStyleName(UIConstants.THEME_GRAY_LINK); * * * links.addComponent(btImportContact); */ links.setSpacing(true); layout.addComponent(links); this.addComponent(layout); this.setComponentAlignment(layout, Alignment.TOP_CENTER); }
From source file:com.esofthead.mycollab.module.crm.view.contact.ContactOpportunityListComp.java
License:Open Source License
@Override protected Component generateTopControls() { VerticalLayout controlsBtnWrap = new VerticalLayout(); controlsBtnWrap.setWidth("100%"); final SplitButton controlsBtn = new SplitButton(); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption(AppContext.getMessage(OpportunityI18nEnum.BUTTON_NEW_OPPORTUNITY)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1L; @Override/*from w w w. ja va2 s .co m*/ public void splitButtonClick(SplitButton.SplitButtonClickEvent event) { fireNewRelatedItem(""); } }); controlsBtn.setSizeUndefined(); Button selectBtn = new Button("Select from existing opportunities", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent event) { ContactOpportunitySelectionWindow opportunitiesWindow = new ContactOpportunitySelectionWindow( ContactOpportunityListComp.this); OpportunitySearchCriteria criteria = new OpportunitySearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(opportunitiesWindow); opportunitiesWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlsLayout = new VerticalLayout(); buttonControlsLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlsLayout); controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY)); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlsBtnWrap; }
From source file:com.esofthead.mycollab.module.crm.view.CrmHomeViewImpl.java
License:Open Source License
@Override protected void displayView() { MHorizontalLayout contentLayout = new MHorizontalLayout().withSpacing(true).withWidth("100%"); VerticalLayout myAssignmentsLayout = new VerticalLayout(); if (AppContext.canRead(RolePermissionCollections.CRM_OPPORTUNITY)) { opportunityChartDashlet = ViewManager.getCacheComponent(IOpportunityPipelineFunnelChartDashlet.class); myAssignmentsLayout.addComponent(opportunityChartDashlet); }/* www . jav a 2 s.c o m*/ if (AppContext.canRead(RolePermissionCollections.CRM_ACCOUNT)) { accountDashlet = new AccountListDashlet(); myAssignmentsLayout.addComponent(accountDashlet); } if (AppContext.canRead(RolePermissionCollections.CRM_MEETING)) { meetingDashlet = new MeetingListDashlet(); myAssignmentsLayout.addComponent(meetingDashlet); } if (AppContext.canRead(RolePermissionCollections.CRM_CALL)) { callDashlet = new CallListDashlet(); myAssignmentsLayout.addComponent(callDashlet); } if (AppContext.canRead(RolePermissionCollections.CRM_LEAD)) { leadDashlet = new LeadListDashlet(); myAssignmentsLayout.addComponent(leadDashlet); } contentLayout.addComponent(myAssignmentsLayout); contentLayout.setExpandRatio(myAssignmentsLayout, 1.0f); MVerticalLayout streamsLayout = new MVerticalLayout().withMargin(new MarginInfo(false, false, false, true)); streamsLayout.setSizeUndefined(); salesDashboard = new SalesDashboardView(); salesDashboard.setWidth("550px"); streamsLayout.addComponent(salesDashboard); streamsLayout.setComponentAlignment(salesDashboard, Alignment.MIDDLE_RIGHT); activityStreamPanel = new ActivityStreamPanel(); activityStreamPanel.setWidth("550px"); streamsLayout.addComponent(activityStreamPanel); streamsLayout.setComponentAlignment(activityStreamPanel, Alignment.MIDDLE_RIGHT); contentLayout.addComponent(streamsLayout); contentLayout.setComponentAlignment(streamsLayout, Alignment.TOP_RIGHT); this.addComponent(contentLayout); displayDashboard(); }
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadCampaignListComp.java
License:Open Source License
@Override protected Component generateTopControls() { VerticalLayout controlBtnWrap = new VerticalLayout(); controlBtnWrap.setWidth("100%"); final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined();//from www. j a v a 2 s. c o m controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CAMPAIGN)); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption(AppContext.getMessage(CampaignI18nEnum.BUTTON_NEW_CAMPAIGN)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1099580202385205069L; @Override public void splitButtonClick(SplitButton.SplitButtonClickEvent event) { fireNewRelatedItem(""); } }); Button selectBtn = new Button("Select from existing campaigns", new Button.ClickListener() { private static final long serialVersionUID = 3046728004767791528L; @Override public void buttonClick(Button.ClickEvent event) { LeadCampaignSelectionWindow leadsWindow = new LeadCampaignSelectionWindow( LeadCampaignListComp.this); CampaignSearchCriteria criteria = new CampaignSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(leadsWindow); leadsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlsLayout = new VerticalLayout(); buttonControlsLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlsLayout); controlBtnWrap.addComponent(controlsBtn); controlBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlBtnWrap; }
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadConvertInfoWindow.java
License:Open Source License
private ComponentContainer createBody() { final CssLayout layout = new CssLayout(); layout.setSizeFull();//from www .ja v a 2 s . c om Label shortDescription = new Label( "<p> By clicking the \"Convert\" button, the following tasks will be done:</p>", ContentMode.HTML); layout.addComponent(shortDescription); VerticalLayout infoLayout = new VerticalLayout(); infoLayout.setMargin(new MarginInfo(false, true, true, true)); infoLayout.setSpacing(true); String createAccountTxt = "Create Account: <span class='" + UIConstants.TEXT_BLUE + "'>" + lead.getAccountname() + "</span>"; Label createAccountLbl = new Label(createAccountTxt, ContentMode.HTML); createAccountLbl.addStyleName(UIConstants.LABEL_CHECKED); infoLayout.addComponent(createAccountLbl); String createContactTxt = "Create Contact: <span class='" + UIConstants.TEXT_BLUE + "'>" + lead.getLastname() + (lead.getFirstname() != null ? " " + lead.getFirstname() : "") + "</span>"; Label createContactLbl = new Label(createContactTxt, ContentMode.HTML); createContactLbl.addStyleName(UIConstants.LABEL_CHECKED); infoLayout.addComponent(createContactLbl); final CheckBox isCreateOpportunityChk = new CheckBox("Create a new opportunity for this account"); isCreateOpportunityChk.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { Boolean isSelected = isCreateOpportunityChk.getValue(); if (isSelected) { opportunityForm = new LeadOpportunityForm(); Opportunity opportunity = new Opportunity(); // this is a trick to pass validation opportunity.setAccountid(0); opportunityForm.setBean(opportunity); layout.addComponent(opportunityForm); } else { layout.removeComponent(opportunityForm); } } }); infoLayout.addComponent(isCreateOpportunityChk); layout.addComponent(infoLayout); return layout; }
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadListDashlet.java
License:Open Source License
public LeadListDashlet() { super("My Leads", new VerticalLayout()); tableItem = new LeadTableDisplay( Arrays.asList(LeadTableFieldDef.name, LeadTableFieldDef.email, LeadTableFieldDef.phoneoffice)); tableItem.addTableListener(new TableClickListener() { @Override//from w w w.j a v a 2 s . c o m public void itemClick(final TableClickEvent event) { final SimpleLead lead = (SimpleLead) event.getData(); if ("leadName".equals(event.getFieldName())) { EventBusFactory.getInstance().post(new LeadEvent.GotoRead(LeadListDashlet.this, lead.getId())); } } }); bodyContent.addComponent(tableItem); Button customizeViewBtn = new Button("", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { UI.getCurrent().addWindow(new LeadListCustomizeWindow(LeadListDashlet.VIEW_DEF_ID, tableItem)); } }); customizeViewBtn.setIcon(FontAwesome.ADJUST); customizeViewBtn.setDescription("Layout Options"); customizeViewBtn.setStyleName(UIConstants.BUTTON_ICON_ONLY); this.addHeaderElement(customizeViewBtn); }
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadListNoItemView.java
License:Open Source License
public LeadListNoItemView() { VerticalLayout layout = new VerticalLayout(); layout.addStyleName("case-noitem"); layout.setWidth("800px"); layout.setSpacing(true);/*from w ww. j av a2 s . c o m*/ layout.setDefaultComponentAlignment(Alignment.TOP_CENTER); layout.setMargin(true); Image image = new Image(null, MyCollabResource.newResource("icons/48/crm/lead.png")); layout.addComponent(image); Label title = new Label(AppContext.getMessage(LeadI18nEnum.VIEW_NO_ITEM_TITLE)); title.addStyleName("h2"); title.setWidthUndefined(); layout.addComponent(title); Label body = new Label(AppContext.getMessage(LeadI18nEnum.VIEW_NO_ITEM_HINT)); body.setWidthUndefined(); layout.addComponent(body); Button btCreateContact = new Button("New Lead", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance().post(new LeadEvent.GotoAdd(this, null)); } }); HorizontalLayout links = new HorizontalLayout(); links.addComponent(btCreateContact); btCreateContact.addStyleName(UIConstants.THEME_GREEN_LINK); /* * Label or = new Label("Or"); or.setStyleName("h2"); * links.addComponent(or); * * Button btImportContact = new Button("Import Leads", new * Button.ClickListener() { private static final long serialVersionUID = * 1L; * * @Override public void buttonClick(ClickEvent arg0) { * UI.getCurrent().addWindow(new CaseImportWindow()); } }); * * btImportContact.addStyleName(UIConstants.THEME_GRAY_LINK); * * * links.addComponent(btImportContact); */ links.setSpacing(true); layout.addComponent(links); this.addComponent(layout); this.setComponentAlignment(layout, Alignment.TOP_CENTER); }
From source file:com.esofthead.mycollab.module.crm.view.opportunity.OpportunityContactListComp.java
License:Open Source License
@Override protected Component generateTopControls() { HorizontalLayout controlsBtnWrap = new HorizontalLayout(); controlsBtnWrap.setWidth("100%"); HorizontalLayout notesWrap = new HorizontalLayout(); notesWrap.setWidth("100%"); notesWrap.setSpacing(true);// www .j a v a 2s . co m Label noteLbl = new Label("Note: "); noteLbl.setSizeUndefined(); noteLbl.setStyleName("list-note-lbl"); notesWrap.addComponent(noteLbl); CssLayout noteBlock = new CssLayout(); noteBlock.setWidth("100%"); noteBlock.setStyleName("list-note-block"); for (int i = 0; i < CrmDataTypeFactory.getOpportunityContactRoleList().length; i++) { Label note = new Label(CrmDataTypeFactory.getOpportunityContactRoleList()[i]); note.setStyleName("note-label"); note.addStyleName(colormap.get(CrmDataTypeFactory.getOpportunityContactRoleList()[i])); note.setSizeUndefined(); noteBlock.addComponent(note); } notesWrap.addComponent(noteBlock); notesWrap.setExpandRatio(noteBlock, 1.0f); controlsBtnWrap.addComponent(notesWrap); final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined(); controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CONTACT)); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption("Add/Edit Contacts' Role"); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1L; @Override public void splitButtonClick(final SplitButton.SplitButtonClickEvent event) { EventBusFactory.getInstance().post(new OpportunityEvent.GotoContactRoleEdit(this, opportunity)); } }); final Button selectBtn = new Button("Select from existing contacts", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final OpportunityContactSelectionWindow contactsWindow = new OpportunityContactSelectionWindow( OpportunityContactListComp.this); final ContactSearchCriteria criteria = new ContactSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(contactsWindow); contactsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlLayout = new VerticalLayout(); buttonControlLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlLayout); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlsBtnWrap; }