Example usage for com.vaadin.ui Button Button

List of usage examples for com.vaadin.ui Button Button

Introduction

In this page you can find the example usage for com.vaadin.ui Button Button.

Prototype

public Button() 

Source Link

Document

Creates a new push button.

Usage

From source file:com.esofthead.mycollab.mobile.module.crm.view.cases.CaseReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    HorizontalLayout toolbarLayout = new HorizontalLayout();
    toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    toolbarLayout.setSpacing(true);/*from   w  w  w  .ja v a2 s.c  o  m*/

    Button relatedContacts = new Button();
    relatedContacts.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_CONTACT
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_CONTACT) + "</div>");
    relatedContacts.setHtmlContentAllowed(true);
    relatedContacts.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new CaseEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateContacts)));
        }
    });
    toolbarLayout.addComponent(relatedContacts);

    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 = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance()
                    .post(new CaseEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateNotes)));
        }
    });
    toolbarLayout.addComponent(relatedNotes);

    Button relatedActivities = new Button();
    relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>");
    relatedActivities.setHtmlContentAllowed(true);
    relatedActivities.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new CaseEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateActivities)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.contact.ContactListViewImpl.java

License:Open Source License

@Override
protected Component createRightComponent() {
    Button addContact = new Button();
    addContact.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override//from   w ww.j av  a2  s  . c  o m
        public void buttonClick(Button.ClickEvent arg0) {
            EventBusFactory.getInstance().post(new ContactEvent.GotoAdd(this, null));
        }
    });
    addContact.setStyleName("add-btn");
    return addContact;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.contact.ContactReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    HorizontalLayout toolbarLayout = new HorizontalLayout();
    toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    toolbarLayout.setSpacing(true);/*from   w  w  w. jav a 2 s  .c  o m*/

    Button relatedOpportunities = new Button();
    relatedOpportunities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_OPPORTUNITY
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_OPPORTUNITY) + "</div>");
    relatedOpportunities.setHtmlContentAllowed(true);
    relatedOpportunities.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(new ContactEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateOpportunityList)));
        }
    });

    toolbarLayout.addComponent(relatedOpportunities);

    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 = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent evt) {
            EventBusFactory.getInstance().post(
                    new ContactEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(noteListItems)));
        }
    });
    toolbarLayout.addComponent(relatedNotes);

    Button relatedActivities = new Button();
    relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>");
    relatedActivities.setHtmlContentAllowed(true);
    relatedActivities.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent evt) {
            EventBusFactory.getInstance().post(new ContactEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateActivityList)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.lead.LeadListViewImpl.java

License:Open Source License

@Override
protected Component createRightComponent() {
    Button addLead = new Button();
    addLead.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -6024437571619598638L;

        @Override/*from  ww  w.  j  ava  2  s .  co  m*/
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new LeadEvent.GotoAdd(this, null));
        }
    });
    addLead.setStyleName("add-btn");
    return addLead;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.lead.LeadReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    HorizontalLayout toolbarLayout = new HorizontalLayout();
    toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    toolbarLayout.setSpacing(true);//ww w  .  j  ava2s.  c o  m

    Button relatedCampaigns = new Button();
    relatedCampaigns.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_CAMPAIGN
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_CAMPAIGN) + "</div>");
    relatedCampaigns.setHtmlContentAllowed(true);
    relatedCampaigns.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7027681785871215444L;

        @Override
        public void buttonClick(ClickEvent event) {
            EventBusFactory.getInstance().post(new LeadEvent.GoToRelatedItems(LeadReadViewImpl.this,
                    new CrmRelatedItemsScreenData(associateCampaigns)));
        }
    });
    toolbarLayout.addComponent(relatedCampaigns);

    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 = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance()
                    .post(new LeadEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateNotes)));
        }
    });
    toolbarLayout.addComponent(relatedNotes);

    Button relatedActivities = new Button();
    relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>");
    relatedActivities.setHtmlContentAllowed(true);
    relatedActivities.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new LeadEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateActivities)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.opportunity.OpportunityListViewImpl.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//w  w w. j av a 2 s.c  o  m
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new OpportunityEvent.GotoAdd(this, null));
        }
    });
    addOpportunity.setStyleName("add-btn");
    return addOpportunity;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.opportunity.OpportunityReadViewImpl.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 2s . co  m

    Button relatedContacts = new Button();
    relatedContacts.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_CONTACT
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_CONTACT) + "</div>");
    relatedContacts.setHtmlContentAllowed(true);
    relatedContacts.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(new OpportunityEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateContacts)));
        }
    });
    toolbarLayout.addComponent(relatedContacts);

    Button relatedLeads = new Button();
    relatedLeads.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_LEAD
            + "\"></span><div class=\"screen-reader-text\">" + AppContext.getMessage(CrmCommonI18nEnum.TAB_LEAD)
            + "</div>");
    relatedLeads.setHtmlContentAllowed(true);
    relatedLeads.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new OpportunityEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateLeads)));
        }
    });
    toolbarLayout.addComponent(relatedLeads);

    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 = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new OpportunityEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateNotes)));
        }
    });
    toolbarLayout.addComponent(relatedNotes);

    Button relatedActivities = new Button();
    relatedActivities.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.CRM_ACTIVITY
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(CrmCommonI18nEnum.TAB_ACTIVITY) + "</div>");
    relatedActivities.setHtmlContentAllowed(true);
    relatedActivities.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 7589415773039335559L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(new OpportunityEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateActivities)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.project.view.bug.BugListViewImpl.java

License:Open Source License

@Override
protected Component createRightComponent() {
    Button addBug = new Button();
    addBug.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 8204610801164300917L;

        @Override//w ww.  ja v  a  2s  .  c  om
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new BugEvent.GotoAdd(this, null));
        }
    });
    addBug.setStyleName("add-btn");
    return addBug;
}

From source file:com.esofthead.mycollab.mobile.module.project.view.bug.BugReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    HorizontalLayout toolbarLayout = new HorizontalLayout();
    toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    toolbarLayout.setSpacing(true);// w ww.j  av  a2 s. co m

    relatedComments = new Button();
    relatedComments.setCaption("<span aria-hidden=\"true\" data-icon=\"" + IconConstants.PROJECT_MESSAGE
            + "\"></span><div class=\"screen-reader-text\">"
            + AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT) + "</div>");
    relatedComments.setHtmlContentAllowed(true);
    relatedComments.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -7469027678729887223L;

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(new ShellEvent.PushView(this, associateComments));
        }
    });
    toolbarLayout.addComponent(relatedComments);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.project.view.message.MessageListViewImpl.java

License:Open Source License

@Override
protected Component createRightComponent() {
    Button addMessage = new Button();
    addMessage.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1556502569683651113L;

        @Override/*ww  w  .  j av a  2  s .  co  m*/
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new MessageEvent.GotoAdd(this, null));
        }
    });
    addMessage.setStyleName("add-btn");
    return addMessage;
}