Example usage for com.vaadin.server FontAwesome PLUS

List of usage examples for com.vaadin.server FontAwesome PLUS

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome PLUS.

Prototype

FontAwesome PLUS

To view the source code for com.vaadin.server FontAwesome PLUS.

Click Source Link

Usage

From source file:com.mycollab.module.crm.view.account.AccountContactListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_CONTACT)) {
        final SplitButton controlsBtn = new SplitButton();
        controlsBtn.addStyleName(WebThemes.BUTTON_ACTION);
        controlsBtn.setCaption(UserUIContext.getMessage(ContactI18nEnum.NEW));
        controlsBtn.setIcon(FontAwesome.PLUS);
        controlsBtn.addClickListener(event -> fireNewRelatedItem(""));
        final MButton selectBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT),
                clickEvent -> {// w w  w . ja  v a  2 s. co  m
                    final AccountContactSelectionWindow contactsWindow = new AccountContactSelectionWindow(
                            AccountContactListComp.this);
                    final ContactSearchCriteria criteria = new ContactSearchCriteria();
                    criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId()));
                    UI.getCurrent().addWindow(contactsWindow);
                    contactsWindow.setSearchCriteria(criteria);
                    controlsBtn.setPopupVisible(false);
                }).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CONTACT));

        OptionPopupContent buttonControlLayout = new OptionPopupContent();
        buttonControlLayout.addOption(selectBtn);
        controlsBtn.setContent(buttonControlLayout);

        controlsBtnWrap.addComponent(controlsBtn);
        controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    }

    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.account.AccountLeadListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_LEAD)) {
        final SplitButton controlsBtn = new SplitButton();
        controlsBtn.addStyleName(WebThemes.BUTTON_ACTION);
        controlsBtn.setCaption(UserUIContext.getMessage(LeadI18nEnum.NEW));
        controlsBtn.setIcon(FontAwesome.PLUS);
        controlsBtn.addClickListener(event -> fireNewRelatedItem(""));
        MButton selectBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT), clickEvent -> {
            AccountLeadSelectionWindow leadsWindow = new AccountLeadSelectionWindow(AccountLeadListComp.this);
            LeadSearchCriteria criteria = new LeadSearchCriteria();
            criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId()));
            UI.getCurrent().addWindow(leadsWindow);
            leadsWindow.setSearchCriteria(criteria);
            controlsBtn.setPopupVisible(false);
        }).withIcon(CrmAssetsManager.getAsset(CrmTypeConstants.LEAD));

        OptionPopupContent buttonControlLayout = new OptionPopupContent();
        buttonControlLayout.addOption(selectBtn);
        controlsBtn.setContent(buttonControlLayout);

        controlsBtnWrap.addComponent(controlsBtn);
        controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    }//  www .j  a  v a  2s. co  m
    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.account.AccountOpportunityListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    MHorizontalLayout controlsBtnWrap = new MHorizontalLayout().withFullWidth();

    MHorizontalLayout notesWrap = new MHorizontalLayout().withFullWidth();
    ELabel noteLbl = new ELabel(UserUIContext.getMessage(GenericI18Enum.OPT_NOTE)).withWidthUndefined();
    notesWrap.addComponent(noteLbl);//  w  w  w . j  av  a2s  . co  m

    CssLayout noteBlock = new CssLayout();
    noteBlock.setWidth("100%");
    noteBlock.setStyleName("list-note-block");
    for (OpportunitySalesStage stage : CrmDataTypeFactory.getOpportunitySalesStageList()) {
        ELabel note = new ELabel(UserUIContext.getMessage(stage))
                .withStyleName("note-label", colormap.get(stage.name())).withWidthUndefined();
        noteBlock.addComponent(note);
    }
    notesWrap.with(noteBlock).expand(noteBlock);
    controlsBtnWrap.with(notesWrap).expand(notesWrap);

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY)) {
        MButton createBtn = new MButton(UserUIContext.getMessage(OpportunityI18nEnum.NEW),
                clickEvent -> fireNewRelatedItem("")).withIcon(FontAwesome.PLUS)
                        .withStyleName(WebThemes.BUTTON_ACTION);

        controlsBtnWrap.with(createBtn).withAlign(createBtn, Alignment.TOP_RIGHT);
    }

    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.account.AccountSearchPanel.java

License:Open Source License

@Override
protected Component buildExtraControls() {
    return (canCreateAccount) ? new MButton(UserUIContext.getMessage(AccountI18nEnum.NEW),
            clickEvent -> EventBusFactory.getInstance().post(new AccountEvent.GotoAdd(this, null)))
                    .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION)
                    .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_ACCOUNT))
            : null;/*  w ww .  ja v  a 2s . c  om*/
}

From source file:com.mycollab.module.crm.view.activity.ActivityRelatedItemListComp.java

License:Open Source License

private void initUI() {
    if (allowCreateNew) {
        HorizontalLayout buttonLayout = new HorizontalLayout();
        buttonLayout.setSpacing(true);//from  w w  w  . j  a va2  s.  c  o  m
        final MButton newTaskBtn = new MButton(UserUIContext.getMessage(TaskI18nEnum.NEW),
                clickEvent -> fireNewRelatedItem("task")).withIcon(FontAwesome.PLUS)
                        .withStyleName(WebThemes.BUTTON_ACTION)
                        .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_TASK));
        buttonLayout.addComponent(newTaskBtn);

        final MButton newCallBtn = new MButton(UserUIContext.getMessage(CallI18nEnum.NEW),
                clickEvent -> fireNewRelatedItem("call")).withIcon(FontAwesome.PLUS)
                        .withStyleName(WebThemes.BUTTON_ACTION)
                        .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_CALL));
        buttonLayout.addComponent(newCallBtn);

        final MButton newMeetingBtn = new MButton(UserUIContext.getMessage(MeetingI18nEnum.NEW),
                clickEvent -> fireNewRelatedItem("meeting")).withIcon(FontAwesome.PLUS)
                        .withStyleName(WebThemes.BUTTON_ACTION)
                        .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_MEETING));
        buttonLayout.addComponent(newMeetingBtn);

        this.addComponent(buttonLayout);
        this.addStyleName("activity-realated-content");
    }

    tableItem = new ActivityTableDisplay(Arrays.asList(
            new TableViewField(ActivityI18nEnum.FORM_SUBJECT, "subject", WebUIConstants.TABLE_EX_LABEL_WIDTH),
            new TableViewField(GenericI18Enum.FORM_STATUS, "status", WebUIConstants.TABLE_S_LABEL_WIDTH),
            new TableViewField(GenericI18Enum.FORM_START_DATE, "startDate",
                    WebUIConstants.TABLE_DATE_TIME_WIDTH),
            new TableViewField(GenericI18Enum.FORM_END_DATE, "endDate", WebUIConstants.TABLE_DATE_TIME_WIDTH)));

    this.addComponent(tableItem);
}

From source file:com.mycollab.module.crm.view.activity.ActivitySearchPanel.java

License:Open Source License

@Override
protected Component buildExtraControls() {
    final SplitButton splitBtn = new SplitButton();
    splitBtn.setSizeUndefined();//from   ww  w. j  a  va  2s. c o  m
    splitBtn.setEnabled(UserUIContext.canWrite(RolePermissionCollections.CRM_CALL)
            || UserUIContext.canWrite(RolePermissionCollections.CRM_MEETING));
    splitBtn.addStyleName(WebThemes.BUTTON_ACTION);
    splitBtn.setIcon(FontAwesome.PLUS);
    splitBtn.setCaption(UserUIContext.getMessage(TaskI18nEnum.NEW));
    splitBtn.addClickListener(
            event -> EventBusFactory.getInstance().post(new ActivityEvent.TaskAdd(this, null)));

    OptionPopupContent btnControlsLayout = new OptionPopupContent();
    splitBtn.setContent(btnControlsLayout);

    Button createMeetingBtn = new Button(UserUIContext.getMessage(MeetingI18nEnum.NEW), clickEvent -> {
        splitBtn.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ActivityEvent.MeetingAdd(this, null));
    });
    btnControlsLayout.addOption(createMeetingBtn);
    createMeetingBtn.setEnabled(UserUIContext.canWrite(RolePermissionCollections.CRM_MEETING));
    final Button createCallBtn = new Button(UserUIContext.getMessage(CallI18nEnum.NEW), clickEvent -> {
        splitBtn.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ActivityEvent.CallAdd(this, null));
    });
    createCallBtn.setEnabled(UserUIContext.canWrite(RolePermissionCollections.CRM_CALL));
    btnControlsLayout.addOption(createCallBtn);

    ButtonGroup viewSwitcher = new ButtonGroup();

    Button calendarViewBtn = new Button("Calendar",
            clickEvent -> EventBusFactory.getInstance().post(new ActivityEvent.GotoCalendar(this, null)));
    calendarViewBtn.addStyleName(WebThemes.BUTTON_ACTION);
    viewSwitcher.addButton(calendarViewBtn);

    Button activityListBtn = new Button("Activities");
    activityListBtn.setStyleName("selected");
    activityListBtn.addStyleName(WebThemes.BUTTON_ACTION);
    viewSwitcher.addButton(activityListBtn);

    return new MHorizontalLayout(splitBtn, viewSwitcher);
}

From source file:com.mycollab.module.crm.view.campaign.CampaignAccountListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_ACCOUNT)) {
        final SplitButton controlsBtn = new SplitButton();
        controlsBtn.addStyleName(WebThemes.BUTTON_ACTION);
        controlsBtn.setCaption(UserUIContext.getMessage(AccountI18nEnum.NEW));
        controlsBtn.setIcon(FontAwesome.PLUS);
        controlsBtn.addClickListener(event -> fireNewRelatedItem(""));
        final Button selectBtn = new Button(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT),
                clickEvent -> {/*from  w w  w.ja v a2  s  . c om*/
                    final CampaignAccountSelectionWindow accountsWindow = new CampaignAccountSelectionWindow(
                            CampaignAccountListComp.this);
                    final AccountSearchCriteria criteria = new AccountSearchCriteria();
                    criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId()));
                    UI.getCurrent().addWindow(accountsWindow);
                    accountsWindow.setSearchCriteria(criteria);
                    controlsBtn.setPopupVisible(false);
                });
        selectBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.ACCOUNT));
        OptionPopupContent buttonControlLayout = new OptionPopupContent();
        buttonControlLayout.addOption(selectBtn);
        controlsBtn.setContent(buttonControlLayout);

        controlsBtnWrap.addComponent(controlsBtn);
        controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    }

    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.campaign.CampaignContactListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_CONTACT)) {
        final SplitButton controlsBtn = new SplitButton();
        controlsBtn.addStyleName(WebThemes.BUTTON_ACTION);
        controlsBtn.setCaption(UserUIContext.getMessage(ContactI18nEnum.NEW));
        controlsBtn.setIcon(FontAwesome.PLUS);
        controlsBtn.addClickListener(event -> fireNewRelatedItem(""));
        final Button selectBtn = new Button(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT),
                clickEvent -> {/*from   w ww . j a  v  a 2 s  .  c o  m*/
                    final CampaignContactSelectionWindow contactsWindow = new CampaignContactSelectionWindow(
                            CampaignContactListComp.this);
                    final ContactSearchCriteria criteria = new ContactSearchCriteria();
                    criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId()));
                    UI.getCurrent().addWindow(contactsWindow);
                    contactsWindow.setSearchCriteria(criteria);
                    controlsBtn.setPopupVisible(false);
                });
        selectBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.CONTACT));
        OptionPopupContent buttonControlLayout = new OptionPopupContent();
        buttonControlLayout.addOption(selectBtn);
        controlsBtn.setContent(buttonControlLayout);

        controlsBtnWrap.addComponent(controlsBtn);
        controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    }

    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.campaign.CampaignLeadListComp.java

License:Open Source License

@Override
protected Component generateTopControls() {
    VerticalLayout controlsBtnWrap = new VerticalLayout();
    controlsBtnWrap.setWidth("100%");

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_LEAD)) {
        final SplitButton controlsBtn = new SplitButton();
        controlsBtn.addStyleName(WebThemes.BUTTON_ACTION);
        controlsBtn.setCaption(UserUIContext.getMessage(LeadI18nEnum.NEW));
        controlsBtn.setIcon(FontAwesome.PLUS);
        controlsBtn.addClickListener(event -> fireNewRelatedItem(""));
        final Button selectBtn = new Button(UserUIContext.getMessage(GenericI18Enum.BUTTON_SELECT),
                clickEvent -> {//from   w ww .jav a 2  s .c  o  m
                    CampaignLeadSelectionWindow leadsWindow = new CampaignLeadSelectionWindow(
                            CampaignLeadListComp.this);
                    LeadSearchCriteria criteria = new LeadSearchCriteria();
                    criteria.setSaccountid(new NumberSearchField(MyCollabUI.getAccountId()));
                    UI.getCurrent().addWindow(leadsWindow);
                    leadsWindow.setSearchCriteria(criteria);
                    controlsBtn.setPopupVisible(false);
                });
        selectBtn.setIcon(CrmAssetsManager.getAsset(CrmTypeConstants.LEAD));
        OptionPopupContent buttonControlLayout = new OptionPopupContent();
        buttonControlLayout.addOption(selectBtn);
        controlsBtn.setContent(buttonControlLayout);

        controlsBtnWrap.addComponent(controlsBtn);
        controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
    }

    return controlsBtnWrap;
}

From source file:com.mycollab.module.crm.view.campaign.CampaignSearchPanel.java

License:Open Source License

@Override
protected Component buildExtraControls() {
    return (canCreateCampaign) ? new MButton(UserUIContext.getMessage(CampaignI18nEnum.NEW),
            clickEvent -> EventBusFactory.getInstance().post(new CampaignEvent.GotoAdd(this, null)))
                    .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION)
                    .withVisible(UserUIContext.canWrite(RolePermissionCollections.CRM_CAMPAIGN))
            : null;/*from  www.ja va  2 s .c om*/
}