Example usage for com.vaadin.ui MenuBar addItem

List of usage examples for com.vaadin.ui MenuBar addItem

Introduction

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

Prototype

public MenuBar.MenuItem addItem(String caption, Resource icon, MenuBar.Command command) 

Source Link

Document

Add a new item to the menu bar.

Usage

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

License:Apache License

@Override
public void createCountryTopicMenu(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);/*  w  w  w .j  ava2s  . co m*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createCountryTopicMenu(menuBar.addItem(COUNTRY_RANKING_TEXT, FontAwesome.SERVER, null));

}

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

License:Apache License

@Override
public void createDocumentMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);/*  ww  w. j  a v a  2s.  c om*/

    menuBar.addItem(OVERVIEW_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.OVERVIEW, pageId));
    menuBar.addItem(CHARTS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.CHARTS, pageId));
    menuBar.addItem(INDICATORS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.INDICATORS, pageId));

    final MenuItem documentItem = menuBar.addItem(DOCUMENT, FontAwesome.FILE, null);

    documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTACTIVITY.toString(), pageId));

    documentItem.addItem(PERSON_REFERENCES, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.PERSONREFERENCES.toString(), pageId));

    documentItem.addItem(DOCUMENT_DETAILS, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDETAILS.toString(), pageId));

    documentItem.addItem(DOCUMENT_DATA, FontAwesome.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
            DocumentPageMode.DOCUMENTDATA.toString(), pageId));

    documentItem.addItem(DOCUMENT_REFERENCES, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId));

    documentItem.addItem(DOCUMENT_DECISION, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDECISION.toString(), pageId));

    documentItem.addItem(DOCUMENT_ATTACHEMENTS, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId));

    menuBar.addItem(PAGE_VISIT_HISTORY_TEXT, null,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}

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

License:Apache License

@Override
public void createMinistryMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);//from  www  . j av  a 2 s  . com

    applicationMenuItemFactory.addRankingMenu(menuBar);

    ministryRankingMenuItemFactory
            .createMinistryRankingTopics(menuBar.addItem(MINISTRY_RANKING, FontAwesome.GROUP, null));

    final MenuItem ministryItem = menuBar.addItem("Ministry " + pageId, FontAwesome.GROUP, null);

    ministryItem.addItem(OVERVIEW_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW, pageId));
    ministryItem.addItem(CHARTS_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.CHARTS, pageId));
    ministryItem.addItem(INDICATORS_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.INDICATORS, pageId));

    final MenuItem rolesItem = ministryItem.addItem(ROLES_TEXT, FontAwesome.GROUP, null);

    rolesItem.addItem(CURRENT_MEMBERS_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.CURRENTMEMBERS.toString(), pageId));

    rolesItem.addItem(MEMBER_HISTORY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.MEMBERHISTORY.toString(), pageId));

    rolesItem.addItem(ROLE_GHANT_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME,
            MinistryPageMode.ROLEGHANT.toString(), pageId));

    rolesItem.addItem(GOVERNMENT_BODIES, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.GOVERNMENT_BODIES.toString(), pageId));

    final MenuItem documentItem = ministryItem.addItem(DOCUMENTS_TEXT, FontAwesome.GROUP, null);

    documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.DOCUMENTACTIVITY.toString(), pageId));

    documentItem.addItem(DOCUMENT_HISTORY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.DOCUMENTHISTORY.toString(), pageId));

    ministryItem.addItem(PAGE_VISIT_HISTORY_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}

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

License:Apache License

@Override
public void createMinistryRankingMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);/*from   w  w  w  .j  a  v a 2 s.co m*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createMinistryRankingTopics(menuBar.addItem(MINISTRY_RANKING, null, null));

}

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

License:Apache License

@Override
public void createParliamentTopicMenu(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);/*from   ww w.  ja va  2  s  .c  o  m*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createParliamentTopicMenu(menuBar.addItem(PARLIAMENT_RANKING_TEXT, FontAwesome.INSTITUTION, null));

}

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

License:Apache License

@Override
public void createPartyMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);//  w  ww. j  a v  a 2s. c  o m

    applicationMenuItemFactory.addRankingMenu(menuBar);

    partyRankingMenuItemFactory
            .createPartyRankingTopics(menuBar.addItem(PARTY_RANKING, FontAwesome.GROUP, null));

    final MenuItem partyItem = menuBar.addItem("Party " + pageId, FontAwesome.GROUP, null);

    partyItem.addItem(OVERVIEW_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.OVERVIEW, pageId));
    partyItem.addItem(CHARTS_TEXT, null,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.CHARTS, pageId));

    partyItem.addItem(INDICATORS_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.INDICATORS, pageId));

    final MenuItem rolesItem = partyItem.addItem(ROLES_TEXT, FontAwesome.GROUP, null);

    rolesItem.addItem(CURRENT_LEADERS, FontAwesome.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME,
            PartyPageMode.CURRENTLEADERS.toString(), pageId));

    rolesItem.addItem(LEADER_HISTORY, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.LEADERHISTORY.toString(), pageId));

    rolesItem.addItem(CURRENT_MEMBERS_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.PARTY_VIEW_NAME, PartyPageMode.CURRENTMEMBERS.toString(), pageId));

    rolesItem.addItem(MEMBER_HISTORY_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.MEMBERHISTORY.toString(), pageId));

    rolesItem.addItem(GOVERMENT_ROLES, FontAwesome.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME,
            PartyPageMode.GOVERNMENTROLES.toString(), pageId));

    rolesItem.addItem(COMMITTEE_ROLES, FontAwesome.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME,
            PartyPageMode.COMMITTEEROLES.toString(), pageId));

    rolesItem.addItem(ROLE_CHART_PARTY_LEADERS, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.ROLEGHANT.toString(), pageId));

    final MenuItem documentItem = partyItem.addItem(DOCUMENTS_TEXT, FontAwesome.GROUP, null);

    documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTACTIVITY.toString(), pageId));

    documentItem.addItem(DOCUMENT_HISTORY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTHISTORY.toString(), pageId));

    final MenuItem ballotItem = partyItem.addItem(BALLOTS_TEXT, FontAwesome.GROUP, null);

    ballotItem.addItem(VOTE_HISTORY, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.VOTEHISTORY.toString(), pageId));

    ballotItem.addItem(BALLOT_DECISION_SUMMARY_TEXT, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEBALLOTDECISIONSUMMARY.toString(), pageId));

    ballotItem.addItem(PARTY_WON_DAILY_SUMMARY_CHART, FontAwesome.GROUP, new PageModeMenuCommand(
            UserViews.PARTY_VIEW_NAME, PartyPageMode.PARTYWONDAILYSUMMARYCHART.toString(), pageId));

    partyItem.addItem(PAGE_VISIT_HISTORY_TEXT, FontAwesome.GROUP,
            new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}

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

License:Apache License

@Override
public void createPartyRankingMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);/*  w  w w. ja v  a 2 s  .  c  o m*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createPartyRankingTopics(menuBar.addItem(PARTY_RANKING, FontAwesome.GROUP, null));

}

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

License:Apache License

@Override
public void createPoliticianMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);/*from   w  ww  .  j a  v a  2 s .  c om*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    politicianRankingMenuItemFactory
            .createPoliticianRankingTopics(menuBar.addItem(POLITICIAN_RANKING, FontAwesome.BUG, null));

    final MenuItem politicanItem = menuBar.addItem("Politician " + pageId, FontAwesome.BUG, null);

    politicanItem.addItem(OVERVIEW_TEXT, FontAwesome.BUG,
            new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.OVERVIEW, pageId));
    politicanItem.addItem(CHARTS_TEXT, FontAwesome.BUG,
            new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.CHARTS, pageId));
    politicanItem.addItem(INDICATORS_TEXT, FontAwesome.BUG,
            new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.INDICATORS, pageId));

    final MenuItem rolesItem = politicanItem.addItem(ROLES_TEXT, FontAwesome.BUG, null);

    rolesItem.addItem(TOTAL_EXPERIENCE, FontAwesome.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME,
            PoliticianPageMode.ROLESUMMARY.toString(), pageId));

    rolesItem.addItem(ROLE_LIST, FontAwesome.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME,
            PoliticianPageMode.ROLELIST.toString(), pageId));

    rolesItem.addItem(ROLE_GHANT_TEXT, FontAwesome.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME,
            PoliticianPageMode.ROLEGHANT.toString(), pageId));

    final MenuItem documentItem = politicanItem.addItem(DOCUMENTS_TEXT, FontAwesome.BUG, null);

    documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, FontAwesome.BUG, new PageModeMenuCommand(
            UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTACTIVITY.toString(), pageId));

    documentItem.addItem(DOCUMENT_HISTORY_TEXT, FontAwesome.BUG, new PageModeMenuCommand(
            UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTHISTORY.toString(), pageId));

    final MenuItem ballotItem = politicanItem.addItem(BALLOTS_TEXT, FontAwesome.BUG, null);

    ballotItem.addItem(VOTE_HISTORY, FontAwesome.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME,
            PoliticianPageMode.VOTEHISTORY.toString(), pageId));

    ballotItem.addItem(BALLOT_DECISION_SUMMARY_TEXT, FontAwesome.BUG, new PageModeMenuCommand(
            UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.BALLOTDECISIONSUMMARY.toString(), pageId));

    politicanItem.addItem(PAGE_VISIT_HISTORY_TEXT, FontAwesome.BUG,
            new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}

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

License:Apache License

@Override
public void createPoliticianRankingMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);/*from   w w  w  . j  a v  a 2 s. com*/

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createPoliticianRankingTopics(menuBar.addItem(POLITICIAN_RANKING, FontAwesome.BUG, null));
}

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

License:Apache License

@Override
public void createUserHomeMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);/*from w  w  w  . j  a va  2 s .  c  o m*/

    menuBar.addItem(OVERVIEW_TEXT, FontAwesome.USER,
            new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, PageMode.OVERVIEW, pageId));

    menuBar.addItem(SECURITY_SETTING_TEXT, FontAwesome.USER, new PageModeMenuCommand(
            UserViews.USERHOME_VIEW_NAME, UserHomePageMode.SECURITY_SETTINGS.toString(), pageId));

    menuBar.addItem(PAGE_VISIT_HISTORY_TEXT, FontAwesome.LINE_CHART,
            new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}