List of usage examples for com.vaadin.ui Button addClickListener
public Registration addClickListener(ClickListener listener)
From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedCaseView.java
License:Open Source License
@Override protected Component createRightComponent() { Button addCase = new Button(); addCase.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/*w w w .j a v a2s. c o m*/ public void buttonClick(Button.ClickEvent arg0) { fireNewRelatedItem(""); } }); addCase.setStyleName("add-btn"); return addCase; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedContactView.java
License:Open Source License
@Override protected Component createRightComponent() { final NavigationBarQuickMenu addContact = new NavigationBarQuickMenu(); addContact.setStyleName("add-btn"); VerticalLayout addButtons = new VerticalLayout(); addButtons.setSpacing(true);/* ww w . j a v a 2s. c o m*/ addButtons.setWidth("100%"); addButtons.setMargin(true); addButtons.addStyleName("edit-btn-layout"); Button newContact = new Button(AppContext.getMessage(ContactI18nEnum.VIEW_NEW_TITLE)); newContact.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent arg0) { fireNewRelatedItem(""); } }); addButtons.addComponent(newContact); Button selectContact = new Button(AppContext.getMessage(ContactI18nEnum.M_TITLE_SELECT_CONTACTS)); selectContact.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 243969948418203441L; @Override public void buttonClick(Button.ClickEvent event) { AccountContactSelectionView contactSelectionView = new AccountContactSelectionView( AccountRelatedContactView.this); final ContactSearchCriteria criteria = new ContactSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); contactSelectionView.setSearchCriteria(criteria); EventBusFactory.getInstance() .post(new ShellEvent.PushView(AccountRelatedContactView.this, contactSelectionView)); } }); addButtons.addComponent(selectContact); addContact.setContent(addButtons); return addContact; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedLeadView.java
License:Open Source License
@Override protected Component createRightComponent() { final NavigationBarQuickMenu addLead = new NavigationBarQuickMenu(); addLead.setStyleName("add-btn"); VerticalLayout addButtons = new VerticalLayout(); addButtons.setSpacing(true);//from w ww . j a v a2 s.c om addButtons.setWidth("100%"); addButtons.setMargin(true); addButtons.addStyleName("edit-btn-layout"); Button newLead = new Button(AppContext.getMessage(LeadI18nEnum.VIEW_NEW_TITLE)); newLead.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 8228954365650824438L; @Override public void buttonClick(Button.ClickEvent arg0) { fireNewRelatedItem(""); } }); addButtons.addComponent(newLead); Button selectLead = new Button(AppContext.getMessage(LeadI18nEnum.M_TITLE_SELECT_LEADS)); selectLead.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 9076596614526838523L; @Override public void buttonClick(Button.ClickEvent event) { AccountLeadSelectionView leadSelectionView = new AccountLeadSelectionView( AccountRelatedLeadView.this); final LeadSearchCriteria criteria = new LeadSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); leadSelectionView.setSearchCriteria(criteria); EventBusFactory.getInstance() .post(new ShellEvent.PushView(AccountRelatedLeadView.this, leadSelectionView)); } }); addButtons.addComponent(selectLead); addLead.setContent(addButtons); return addLead; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountRelatedOpportunityView.java
License:Open Source License
@Override protected Component createRightComponent() { Button addOpportunity = new Button(); addOpportunity.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 7172838996944732255L; @Override/*from w w w .ja v a 2s .c o m*/ public void buttonClick(Button.ClickEvent event) { fireNewRelatedItem(""); } }); addOpportunity.setStyleName("add-btn"); return addOpportunity; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.ActivityListViewImpl.java
License:Open Source License
@Override protected Component createRightComponent() { final NavigationBarQuickMenu addActivity = new NavigationBarQuickMenu(); addActivity.setStyleName("add-btn"); addButtons = new VerticalLayout(); addButtons.setSpacing(true);/*from www . j a v a2 s . c o m*/ addButtons.setWidth("100%"); addButtons.setMargin(true); addButtons.addStyleName("edit-btn-layout"); Button addTask = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK)); addTask.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1920289198458066344L; @Override public void buttonClick(Button.ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.TaskAdd(this, null)); } }); addButtons.addComponent(addTask); Button addCall = new Button(AppContext.getMessage(CallI18nEnum.BUTTON_NEW_CALL)); addCall.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -279151189261011902L; @Override public void buttonClick(Button.ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.CallAdd(this, null)); } }); addButtons.addComponent(addCall); Button addMeeting = new Button(AppContext.getMessage(MeetingI18nEnum.BUTTON_NEW_MEETING)); addMeeting.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 4770664404728700960L; @Override public void buttonClick(Button.ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null)); } }); addButtons.addComponent(addMeeting); addActivity.setContent(addButtons); return addActivity; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.ActivityRelatedItemView.java
License:Open Source License
@Override protected Component createRightComponent() { final NavigationBarQuickMenu addActivity = new NavigationBarQuickMenu(); addActivity.setStyleName("add-btn"); addButtons = new VerticalLayout(); addButtons.setSpacing(true);/*w w w. j a v a2 s.c o m*/ addButtons.setWidth("100%"); addButtons.setMargin(true); addButtons.addStyleName("edit-btn-layout"); Button addTask = new Button(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK)); addTask.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1920289198458066344L; @Override public void buttonClick(Button.ClickEvent event) { fireNewRelatedItem(CrmTypeConstants.TASK); } }); addButtons.addComponent(addTask); Button addCall = new Button(AppContext.getMessage(CallI18nEnum.BUTTON_NEW_CALL)); addCall.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -279151189261011902L; @Override public void buttonClick(Button.ClickEvent event) { fireNewRelatedItem(CrmTypeConstants.CALL); } }); addButtons.addComponent(addCall); Button addMeeting = new Button(AppContext.getMessage(MeetingI18nEnum.BUTTON_NEW_MEETING)); addMeeting.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 4770664404728700960L; @Override public void buttonClick(Button.ClickEvent event) { fireNewRelatedItem(CrmTypeConstants.MEETING); } }); addButtons.addComponent(addMeeting); addActivity.setContent(addButtons); return addActivity; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.AssignmentReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { HorizontalLayout toolbarLayout = new HorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); toolbarLayout.setSpacing(true);//from www. j av a 2 s . co m Button relatedNotes = new Button(); relatedNotes.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_DOCUMENT + "\"></span><div class=\"screen-reader-text\">" + AppContext.getMessage(CrmCommonI18nEnum.TAB_NOTE) + "</div>"); relatedNotes.setHtmlContentAllowed(true); relatedNotes.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 8846423206027007038L; @Override public void buttonClick(ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.GoToRelatedItems(AssignmentReadViewImpl.this, new CrmRelatedItemsScreenData(associateNotes))); } }); toolbarLayout.addComponent(relatedNotes); return toolbarLayout; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.CallReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { HorizontalLayout toolbarLayout = new HorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); toolbarLayout.setSpacing(true);/* w ww. j ava2 s . c om*/ Button relatedNotes = new Button(); relatedNotes.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_DOCUMENT + "\"></span><div class=\"screen-reader-text\">" + AppContext.getMessage(CrmCommonI18nEnum.TAB_NOTE) + "</div>"); relatedNotes.setHtmlContentAllowed(true); relatedNotes.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 8846423206027007038L; @Override public void buttonClick(ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.GoToRelatedItems(CallReadViewImpl.this, new CrmRelatedItemsScreenData(associateNotes))); } }); toolbarLayout.addComponent(relatedNotes); return toolbarLayout; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.activity.MeetingReadViewImpl.java
License:Open Source License
@Override protected ComponentContainer createBottomPanel() { HorizontalLayout toolbarLayout = new HorizontalLayout(); toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); toolbarLayout.setSpacing(true);//w w w . j av a 2 s.c o m Button relatedNotes = new Button(); relatedNotes.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_DOCUMENT + "\"></span><div class=\"screen-reader-text\">" + AppContext.getMessage(CrmCommonI18nEnum.TAB_NOTE) + "</div>"); relatedNotes.setHtmlContentAllowed(true); relatedNotes.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 8846423206027007038L; @Override public void buttonClick(ClickEvent event) { EventBusFactory.getInstance().post(new ActivityEvent.GoToRelatedItems(MeetingReadViewImpl.this, new CrmRelatedItemsScreenData(associateNotes))); } }); toolbarLayout.addComponent(relatedNotes); return toolbarLayout; }
From source file:com.esofthead.mycollab.mobile.module.crm.view.campaign.CampaignListViewImpl.java
License:Open Source License
@Override protected Component createRightComponent() { Button addCampaign = new Button(); addCampaign.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/* w w w . j av a 2s . co m*/ public void buttonClick(Button.ClickEvent arg0) { EventBusFactory.getInstance().post(new CampaignEvent.GotoAdd(this, null)); } }); addCampaign.setStyleName("add-btn"); return addCampaign; }