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.account.AccountListViewImpl.java

License:Open Source License

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

        @Override//  w  w w.  j  a v  a  2  s  .  co m
        public void buttonClick(Button.ClickEvent arg0) {
            EventBusFactory.getInstance().post(new AccountEvent.GotoAdd(this, null));
        }
    });
    addAccount.setStyleName("add-btn");
    return addAccount;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountReadViewImpl.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.j  a v a  2  s .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 AccountEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateContacts)));
        }
    });
    toolbarLayout.addComponent(relatedContacts);

    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 AccountEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateOpportunities)));
        }
    });
    toolbarLayout.addComponent(relatedOpportunities);

    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 AccountEvent.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 AccountEvent.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 AccountEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateActivities)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

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//from  w  w w  .j  a  v  a  2 s . 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.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//  w w  w  .j a 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.AssignmentReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    HorizontalLayout toolbarLayout = new HorizontalLayout();
    toolbarLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    toolbarLayout.setSpacing(true);//ww w.ja  v  a2  s .com

    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 av  a  2  s . com*/

    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  ww . j  a v  a 2s  .  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//ww w  .jav a  2 s .  com
        public void buttonClick(Button.ClickEvent arg0) {
            EventBusFactory.getInstance().post(new CampaignEvent.GotoAdd(this, null));
        }
    });
    addCampaign.setStyleName("add-btn");
    return addCampaign;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.campaign.CampaignReadViewImpl.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  .j  a  va 2 s.  c o  m

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

        @Override
        public void buttonClick(ClickEvent arg0) {
            EventBusFactory.getInstance().post(
                    new CampaignEvent.GoToRelatedItems(this, new CrmRelatedItemsScreenData(associateAccounts)));
        }
    });
    toolbarLayout.addComponent(relatedAccounts);

    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 CampaignEvent.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 CampaignEvent.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 CampaignEvent.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 CampaignEvent.GoToRelatedItems(this,
                    new CrmRelatedItemsScreenData(associateActivities)));
        }
    });
    toolbarLayout.addComponent(relatedActivities);

    return toolbarLayout;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.cases.CaseListViewImpl.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  va2 s.  c o m*/
        public void buttonClick(Button.ClickEvent arg0) {
            EventBusFactory.getInstance().post(new CaseEvent.GotoAdd(this, null));
        }
    });
    addCase.setStyleName("add-btn");
    return addCase;
}