Example usage for com.vaadin.server FontAwesome FLAG

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

Introduction

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

Prototype

FontAwesome FLAG

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

Click Source Link

Usage

From source file:com.esofthead.mycollab.module.project.view.bug.components.UnresolvedBugsByStatusWidget.java

License:Open Source License

@Override
protected void displayPlainMode() {
    bodyContent.removeAllComponents();// w ww  . j  a  v  a 2 s  .  c o m
    BugStatusClickListener listener = new BugStatusClickListener();
    if (!groupItems.isEmpty()) {
        for (OptionI18nEnum.BugStatus status : OptionI18nEnum.bug_statuses) {
            boolean isFound = false;
            for (GroupItem item : groupItems) {
                if (status.name().equals(item.getGroupid())) {
                    isFound = true;
                    MHorizontalLayout statusLayout = new MHorizontalLayout().withFullWidth();
                    statusLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
                    ButtonI18nComp statusLink = new ButtonI18nComp(status.name(), status, listener);
                    statusLink.setWidth("110px");
                    statusLink.setIcon(FontAwesome.FLAG);
                    statusLink.setStyleName(UIConstants.BUTTON_LINK);

                    ProgressBarIndicator indicator = new ProgressBarIndicator(totalCount,
                            totalCount - item.getValue().intValue(), false);
                    indicator.setWidth("100%");
                    statusLayout.with(statusLink, indicator).expand(indicator);
                    bodyContent.addComponent(statusLayout);
                }
            }

            if (!isFound && !status.name().equals(OptionI18nEnum.BugStatus.Resolved.name())
                    && !status.name().equals(OptionI18nEnum.BugStatus.Verified.name())) {
                MHorizontalLayout statusLayout = new MHorizontalLayout().withFullWidth();
                statusLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
                Button statusLink = new ButtonI18nComp(status.name(), status, listener);
                statusLink.setWidth("110px");
                statusLink.setIcon(FontAwesome.FLAG);
                statusLink.setStyleName(UIConstants.BUTTON_LINK);
                ProgressBarIndicator indicator = new ProgressBarIndicator(totalCount, totalCount, false);
                indicator.setWidth("100%");
                statusLayout.with(statusLink, indicator).expand(indicator);
                bodyContent.addComponent(statusLayout);
            }
        }
    }
}

From source file:com.esofthead.mycollab.module.project.view.task.components.UnresolvedTaskByStatusWidget.java

License:Open Source License

@Override
protected void displayPlainMode() {
    this.bodyContent.removeAllComponents();
    TaskStatusClickListener listener = new TaskStatusClickListener();
    this.setTitle(
            AppContext.getMessage(TaskI18nEnum.WIDGET_UNRESOLVED_BY_STATUS_TITLE) + " (" + totalCount + ")");

    if (!groupItems.isEmpty()) {
        OptionValService optionValService = AppContextUtil.getSpringBean(OptionValService.class);
        List<OptionVal> optionVals = optionValService.findOptionVals(ProjectTypeConstants.TASK,
                CurrentProjectVariables.getProjectId(), AppContext.getAccountId());

        for (OptionVal optionVal : optionVals) {
            if (OptionI18nEnum.StatusI18nEnum.Closed.name().equals(optionVal.getTypeval())) {
                continue;
            }//from w w  w. j a  v a2s  . c o m
            boolean isFound = false;
            for (GroupItem item : groupItems) {
                if (optionVal.getTypeval().equals(item.getGroupid())) {
                    isFound = true;
                    MHorizontalLayout statusLayout = new MHorizontalLayout().withFullWidth();
                    statusLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
                    String statusCaption = AppContext.getMessage(OptionI18nEnum.StatusI18nEnum.class,
                            optionVal.getTypeval());
                    MButton statusLink = new ButtonI18nComp(optionVal.getTypeval())
                            .withCaption(StringUtils.trim(statusCaption, 25, true))
                            .withDescription(statusCaption).withListener(listener)
                            .withStyleName(UIConstants.BUTTON_LINK).withIcon(FontAwesome.FLAG);
                    statusLink.setWidth("110px");

                    statusLayout.addComponent(statusLink);
                    ProgressBarIndicator indicator = new ProgressBarIndicator(totalCount,
                            totalCount - item.getValue().intValue(), false);
                    indicator.setWidth("100%");
                    statusLayout.with(indicator).expand(indicator);

                    bodyContent.addComponent(statusLayout);
                }
            }
            if (!isFound) {
                MHorizontalLayout statusLayout = new MHorizontalLayout().withFullWidth();
                statusLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
                String statusCaption = AppContext.getMessage(OptionI18nEnum.StatusI18nEnum.class,
                        optionVal.getTypeval());
                MButton statusLink = new ButtonI18nComp(optionVal.getTypeval())
                        .withCaption(StringUtils.trim(statusCaption, 25, true)).withDescription(statusCaption)
                        .withListener(listener).withStyleName(UIConstants.BUTTON_LINK)
                        .withIcon(FontAwesome.FLAG);
                statusLink.addStyleName(UIConstants.TEXT_ELLIPSIS);
                statusLink.setWidth("110px");
                statusLayout.addComponent(statusLink);
                ProgressBarIndicator indicator = new ProgressBarIndicator(totalCount, totalCount, false);
                indicator.setWidth("100%");
                statusLayout.with(indicator).expand(indicator);
                this.bodyContent.addComponent(statusLayout);
            }
        }
    }
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl.AbstractMenuItemFactoryImpl.java

License:Apache License

/**
 * Creates the admin menu.//from   w  ww . j ava 2 s  . c  o  m
 *
 * @param mainViewItem
 *            the main view item
 */
private static void createAdminMenu(final MenuItem mainViewItem) {
    if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN)) {
        final MenuItem adminMenuItem = mainViewItem.addItem(ADMIN_TEXT, FontAwesome.SERVER, null);

        final MenuItem configurationMenuItem = adminMenuItem.addItem(CONFIGURATION, FontAwesome.GEARS, null);
        configurationMenuItem.addItem(APPLICATION_CONFIGURATION, FontAwesome.GEARS, COMMAND6);

        configurationMenuItem.addItem(AGENCY, FontAwesome.SERVER, COMMAND7);
        configurationMenuItem.addItem(PORTAL, FontAwesome.SITEMAP, COMMAND8);
        configurationMenuItem.addItem(COUNTRY, FontAwesome.FLAG, COMMAND9);
        configurationMenuItem.addItem(LANGUAGE, FontAwesome.LANGUAGE, COMMAND10);
        configurationMenuItem.addItem(LANGUAGE_CONTENT, FontAwesome.FILE_TEXT, COMMAND11);

        final MenuItem managementMenuItem = adminMenuItem.addItem(MANAGEMENT, FontAwesome.SERVER, null);

        managementMenuItem.addItem(AGENT_OPERATIONS_TEXT, FontAwesome.USER_SECRET, COMMAND12);

        managementMenuItem.addItem(DATA_SUMMARY_TEXT, FontAwesome.DATABASE, COMMAND13);

        managementMenuItem.addItem("Email", FontAwesome.MAIL_FORWARD, COMMAND19);

        managementMenuItem.addItem(SYSTEM_PERFORMANCE, FontAwesome.DASHBOARD, COMMAND14);

        final MenuItem userActivityMenuItem = adminMenuItem.addItem(USER_ACTIVITY, FontAwesome.DATABASE, null);
        userActivityMenuItem.addItem(APPLICATION_SESSION, FontAwesome.LAPTOP, COMMAND15);
        userActivityMenuItem.addItem(APPLICATION_EVENT, FontAwesome.ARROWS, COMMAND16);
        userActivityMenuItem.addItem(APPLICATION_EVENT_CHARTS, FontAwesome.ARROWS, COMMAND20);

        userActivityMenuItem.addItem(USERACCOUNT, FontAwesome.GROUP, COMMAND17);

    }
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl.ApplicationMenuItemFactoryImpl.java

License:Apache License

@Override
public void addRankingMenu(final MenuBar menuBar) {

    final MenuItem rankingsMenuItem = menuBar.addItem(RANKING_TEXT, FontAwesome.AREA_CHART, null);

    final MenuItem countryMenuItem = rankingsMenuItem.addItem(COUNTRY_RANKING_LINK_TEXT, FontAwesome.FLAG,
            COMMAND7);/*from  ww w.j a  v  a2s .  c  om*/

    countryMenuItemFactory.createCountryTopicMenu(countryMenuItem);

    final MenuItem parliamentMenuItem = rankingsMenuItem.addItem(PARLIAMENT_RANKING_LINK_TEXT,
            FontAwesome.INSTITUTION, COMMAND5);

    parliamentMenuItemFactory.createParliamentTopicMenu(parliamentMenuItem);

    final MenuItem politicianMenuItem = rankingsMenuItem.addItem(POLITICIAN_RANKING_LINK_TEXT, FontAwesome.USER,
            COMMAND);

    politicianRankingMenuItemFactory.createPoliticianRankingTopics(politicianMenuItem);

    final MenuItem partynMenuItem = rankingsMenuItem.addItem(PARTY_RANKING_LINK_TEXT, FontAwesome.GROUP,
            COMMAND2);

    partyRankingMenuItemFactory.createPartyRankingTopics(partynMenuItem);

    final MenuItem committeeMenuItem = rankingsMenuItem.addItem(COMMITTEE_RANKING_LINK_TEXT, FontAwesome.GROUP,
            COMMAND3);

    committeeRankingMenuItemFactory.createCommitteeRankingTopics(committeeMenuItem);

    final MenuItem ministryMenuItem = rankingsMenuItem.addItem(MINISTRY_RANKING_LINK_TEXT, FontAwesome.GROUP,
            COMMAND4);

    ministryRankingMenuItemFactory.createMinistryRankingTopics(ministryMenuItem);

}

From source file:com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl.ApplicationMenuItemFactoryImpl.java

License:Apache License

@Override
public void createOverviewPage(final VerticalLayout panelContent) {
    final GridLayout grid = createGridLayout(panelContent);

    createButtonLink(grid, COUNTRY_RANKING_LINK_TEXT, FontAwesome.FLAG, COMMAND7, "Description");

    createButtonLink(grid, PARLIAMENT_RANKING_LINK_TEXT, FontAwesome.INSTITUTION, COMMAND5, "Description");

    createButtonLink(grid, POLITICIAN_RANKING_LINK_TEXT, FontAwesome.USER, COMMAND, "Description");

    createButtonLink(grid, PARTY_RANKING_LINK_TEXT, FontAwesome.GROUP, COMMAND2, "Description");

    createButtonLink(grid, COMMITTEE_RANKING_LINK_TEXT, FontAwesome.GROUP, COMMAND3, "Description");

    createButtonLink(grid, MINISTRY_RANKING_LINK_TEXT, FontAwesome.GROUP, COMMAND4, "Description");

}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createCountryRankingViewPageLink() {
    final Link pageLink = new Link(COUNTRY_RANKING_LINK_TEXT,
            new ExternalResource(LINK_SEPARATOR + UserViews.COUNTRY_RANKING_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_TEST_CHART_VIEW.name());
    pageLink.setIcon(FontAwesome.FLAG);
    return pageLink;
}

From source file:ui.item.InfoViewNew.java

public InfoViewNew(T achievement) {
    setSizeFull();//  w  ww. j av a  2s. c om
    setMargin(true);
    setMargin(new MarginInfo(false, true, false, true));
    this.achievement = achievement;
    this.title = new InfoTitle();
    this.body = new InfoBody();
    addComponents(title, body);

    actions = new InfoActions();
    if ((this.getMyUI() instanceof UserUI) && !(this.getMyUI() instanceof VisitorUI)) {
        edit = new LifetimeButtonSmall("edit", FontAwesome.EDIT);
        delete = new LifetimeButtonSmall("delete", FontAwesome.TRASH_O);
        hide = new LifetimeButtonSmall("hide", FontAwesome.EYE);
        translate = new LifetimeButtonSmall("translate", FontAwesome.FLAG);
        participate = new LifetimeButtonSmall("e-participate", FontAwesome.FLAG);
        edit.addClickListener(this);
        delete.addClickListener(this);
        hide.addClickListener(this);
        translate.addClickListener(this);
        participate.addClickListener(this);
        actions.addComponents(edit, delete, hide, translate, participate);
        addComponent(actions);
        actions.setEnabled(false);
    }
    setStyleName("info");
}

From source file:ui.menu.LifetimeMenu.java

License:Apache License

private void initLanguageOptions() {
    languageButton = new LifetimeButtonLink("Languages", FontAwesome.FLAG);
    languageButton.addClickListener(this);
    languageButton.addFocusListener(this);
    missingTranslationsButton = new TranslateButton(userId, language);
    missingTranslationsButton.addClickListener(this);
    missingTranslationsButton.addFocusListener(this);
    languages = new UserLanguages(userId, language);
    VerticalLayout options = new VerticalLayout(missingTranslationsButton, languages);
    options.setStyleName("v-menu-options");
    menu.put(languageButton, options);/* w ww.  ja  va 2s.c o m*/
}