Java Code Examples for com.vaadin.ui.MenuBar.MenuItem#addItem()
The following examples show how to use
com.vaadin.ui.MenuBar.MenuItem#addItem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DashboardMenu.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private Component buildUserMenu(final UiProperties uiProperties) { final MenuBar settings = new MenuBar(); settings.addStyleName("user-menu"); settings.setHtmlContentAllowed(true); final MenuItem settingsItem = settings.addItem("", getImage(uiProperties.isGravatar()), null); final String formattedTenant = UserDetailsFormatter.formatCurrentTenant(); if (!StringUtils.isEmpty(formattedTenant)) { settingsItem.setText(formattedTenant); UserDetailsFormatter.getCurrentTenant().ifPresent(tenant -> settingsItem.setDescription(i18n .getMessage("menu.user.description", tenant, UserDetailsFormatter.getCurrentUser().getUsername()))); } else { settingsItem.setText("..."); } settingsItem.setStyleName("user-menuitem"); final String logoutUrl = generateLogoutUrl(); settingsItem.addItem(i18n.getMessage("label.sign.out"), selectedItem -> Page.getCurrent().setLocation(logoutUrl)); return settings; }
Example 2
Source File: AbstractMenuItemFactoryImpl.java From cia with Apache License 2.0 | 6 votes |
/** * Inits the application menu bar. * * @param menuBar * the menu bar */ protected final void initApplicationMenuBar(final MenuBar menuBar) { menuBar.removeItems(); menuBar.setWidth(MENU_BAR_WIDTH); menuBar.setStyleName(HEADER_STYLE_NAME); final MenuItem mainViewItem = menuBar.addItem(APPLICATION, VaadinIcons.SERVER, null); mainViewItem.addItem(START_TEXT, VaadinIcons.STAR, COMMAND_MAINVIEW_OVERVIEW); final MenuItem mainItem = mainViewItem.addItem(MAIN, VaadinIcons.STAR, null); mainItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.LINE_CHART, COMMAND_MAINVIEW_PAGEVISITHISTORY); if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN) || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) { mainViewItem.addItem(USERHOME, VaadinIcons.USER,COMMAND_USERHOME); createAdminMenu(mainViewItem); mainViewItem.addItem(LOGOUT, VaadinIcons.SIGN_OUT, COMMAND_LOGOUT); } else { mainViewItem.addItem(LOGIN, VaadinIcons.SIGN_IN, COMMAND_LOGIN); mainViewItem.addItem(REGISTER, VaadinIcons.FILE_ADD, COMMAND_REGISTER); } }
Example 3
Source File: PartyRankingMenuItemFactoryImpl.java From cia with Apache License 2.0 | 5 votes |
@Override public void createPartyRankingTopics(final MenuItem partynMenuItem) { partynMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, COMMAND_OVERVIEW); final MenuItem listByTopic = partynMenuItem.addItem(RANKING_LIST_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); final MenuItem listItem = listByTopic.addItem(TOTAL_MEMBERS,VaadinIcons.GROUP, COMMAND_DATAGRID); listItem.setDescription(PARTY_BY_TOTAL_MEMBERS_BASED_ON_ROLES_IN_DEPARTMENTS_COMMITTEES_AND_PARLIAMENT); final MenuItem chartByTopic = partynMenuItem.addItem(CHART_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_MINISTRIES_HEAD_COUNT_TEXT,VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_GOVERNMENT_PARTIES); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_HEAD_COUNT,VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_COMMITTEES); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_PARLIAMENT_HEAD_COUNT,VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_PARTIES); chartByTopic.addItem(ALL_PARTIES_TOTAL_DAYS_SERVED_IN_PARLIAMENT,VaadinIcons.GROUP, COMMAND_CHARTS_ALL_PARTIES); partynMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISITHISTORY); }
Example 4
Source File: DocumentMenuItemFactoryImpl.java From cia with Apache License 2.0 | 5 votes |
@Override public void createDocumentsMenuBar(final MenuBar menuBar) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); final MenuItem documentsItem = menuBar.addItem(DOCUMENTS, VaadinIcons.FILE, null); documentsItem.addItem("List all",VaadinIcons.GROUP, COMMAND_DOCUMENTS); documentsItem.addItem("Search Documents",VaadinIcons.GROUP, COMMAND_SEARCH_DOCUMENT); }
Example 5
Source File: CommitteeRankingMenuItemFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
/** * Creates the committee ranking topics. * * @param committeeMenuItem * the committee menu item */ @Override public void createCommitteeRankingTopics(final MenuItem committeeMenuItem) { committeeMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, COMMAND_OVERVIEW); final MenuItem listByTopic = committeeMenuItem.addItem(RANKING_LIST_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); final MenuItem listItem = listByTopic.addItem(POLITICAL_WORK_SUMMARY_TEXT,VaadinIcons.GROUP, COMMAND_DATAGRID); listItem.setDescription(CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_POLTICIAL_DAYS); final MenuItem chartByTopic = committeeMenuItem.addItem(CHART_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); chartByTopic.addItem(CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS,VaadinIcons.GROUP, COMMAND_COMMITTEES_BY_PARTY); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED); chartByTopic.addItem(ALL_COMMITTEES_TOTAL_MEMBERS,VaadinIcons.GROUP, COMMAND_ALL_COMMITTEES_BY_HEADCOUNT); committeeMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISIT_HISTORY); }
Example 6
Source File: ContextMenuUI.java From context-menu with Apache License 2.0 | 4 votes |
private void fillMenu(ContextMenu menu) { final MenuItem item = menu.addItem("Checkable \u00d6", e -> Notification.show("checked: " + e.isChecked()) ); item.setCheckable(true); item.setChecked(true); MenuItem item2 = menu.addItem("Disabled",new ClassResource("/images/tiger.jpg"), e -> Notification.show("disabled") ); item2.setDescription("Disabled item"); item2.setEnabled(false); MenuItem item3 = menu.addItem("Invisible", e -> Notification.show("invisible") ); item3.setVisible(false); menu.addSeparator(); //The path is /resources/images/kitten.jpg ClassResource ico = new ClassResource("/images/kitten.jpg"); MenuItem item4 = menu.addItem("Icon + Description + <b>HTML</b>",ico, e -> Notification.show("icon") ); item4.setDescription("Test tooltip"); but3.addClickListener(e -> item4.setDescription("")); MenuItem item5 = menu.addItem("Custom stylename", e -> Notification.show("stylename") ); //The path is /webapp/VAADIN/themes/contextmenu/images ThemeResource resource = new ThemeResource("images/cat.jpg"); item5.setIcon(resource); item5.setStyleName("teststyle"); MenuItem item6 = menu.addItem("Submenu"); item6.addItem("Subitem", VaadinIcons.OPTION, e -> Notification.show("SubItem")); item6.addSeparator(); item6.addItem("Subitem",new ThemeResource("images/cat2.jpg"), e -> Notification.show("SubItem")) .setDescription("Test"); MenuItem openWindowNotification = item6.addItem( "Open Window + Notification", e -> Notification.show("Open Vaadin.com")); new BrowserWindowOpener("https://vaadin.com").extend(openWindowNotification); MenuItem openWindowDummy = item6.addItem("Open Google"); new BrowserWindowOpener("https://google.com").extend(openWindowDummy); new BrowserWindowOpener("https://yahoo.com") .extend(item6.addItem("SubMenu2").addItem("Yahoo!")); }
Example 7
Source File: PoliticianRankingMenuItemFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
@Override public void createPoliticianRankingTopics(final MenuItem politicianMenuItem) { politicianMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.BUG, COMMAND_OVERVIEW); final MenuItem listByTopic = politicianMenuItem.addItem(RANKING_LIST_BY_TOPIC_TEXT, VaadinIcons.BUG, null); final MenuItem listItem = listByTopic.addItem(POLITICAL_EXPERIENCE_SUMMARY, VaadinIcons.BUG, COMMAND_DATAGRID); listItem.setDescription(CURRENT_AND_PAST_ASSIGNMENTS_AND_SUMMARY_EXPERIENCE_IN_DAYS); final MenuItem chartByTopic = politicianMenuItem.addItem(CHART_BY_TOPIC_TEXT, VaadinIcons.BUG, null); chartByTopic.addItem(ALL_PARTIES, VaadinIcons.GROUP, COMMAND_ALL_PARTIES); chartByTopic.addItem(CURRENT_PARTIES, VaadinIcons.GROUP, COMMAND_CURRENT_PARTIES); politicianMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.BUG, COMMAND_PAGEVISITHISTORY); }
Example 8
Source File: UserHomeMenuItemFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
@Override public void createUserHomeMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); final MenuItem accountItem = menuBar.addItem("Useraccount", VaadinIcons.USER,null); accountItem.addItem(OVERVIEW_TEXT, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, PageMode.OVERVIEW, pageId)); accountItem.addItem(SECURITY_SETTING_TEXT, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.SECURITY_SETTINGS.toString(), pageId)); accountItem.addItem(USER_VISITS, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.USER_VISITS.toString(), pageId)); accountItem.addItem(USER_EVENTS, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.USER_EVENTS.toString(), pageId)); }
Example 9
Source File: DocumentMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void createDocumentMenuBar(final MenuBar menuBar, final String pageId) { createDocumentsMenuBar(menuBar); final MenuItem documentItem = menuBar.addItem(DOCUMENT, VaadinIcons.FILE, null); documentItem.addItem(OVERVIEW_TEXT, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.OVERVIEW, pageId)); documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTACTIVITY.toString(), pageId)); documentItem.addItem(PERSON_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.PERSONREFERENCES.toString(), pageId)); documentItem.addItem(DOCUMENT_DETAILS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDETAILS.toString(), pageId)); documentItem.addItem(DOCUMENT_DATA, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDATA.toString(), pageId)); documentItem.addItem(DOCUMENT_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId)); documentItem.addItem(DOCUMENT_DECISION, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDECISION.toString(), pageId)); documentItem.addItem(DOCUMENT_ATTACHEMENTS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId)); documentItem.addItem(PAGE_VISIT_HISTORY_TEXT, null, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.PAGEVISITHISTORY,pageId)); }
Example 10
Source File: GovernmentBodyMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void createGovernmentBodyMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); governmentBodyRankingMenuItemFactory.createGovernmentBodyRankingTopics(menuBar.addItem(GOVERNMENT_BODY_RANKING, VaadinIcons.GROUP,null)); final MenuItem governmentBodyItem = menuBar.addItem("GovernmentBody "+ pageId, VaadinIcons.GROUP,null); governmentBodyItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, PageMode.OVERVIEW, pageId)); governmentBodyItem.addItem(HEADCOUNT_CHART, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.HEADCOUNT.toString(), pageId)); governmentBodyItem.addItem(INCOME, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.INCOME.toString(), pageId)); governmentBodyItem.addItem(EXPENDITURE, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, GovernmentBodyPageMode.EXPENDITURE.toString(), pageId)); governmentBodyItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId)); }
Example 11
Source File: ApplicationMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void addRankingMenu(final MenuBar menuBar) { final MenuItem rankingsMenuItem = menuBar.addItem(RANKING_TEXT, VaadinIcons.LINE_CHART, null); final MenuItem countryMenuItem = rankingsMenuItem.addItem(COUNTRY_RANKING_LINK_TEXT,VaadinIcons.FLAG, COMMAND_COUNTRY_RANKING_OVERVIEW); countryMenuItemFactory.createCountryTopicMenu(countryMenuItem); final MenuItem parliamentMenuItem = rankingsMenuItem.addItem(PARLIAMENT_RANKING_LINK_TEXT,VaadinIcons.INSTITUTION, COMMAND_PARLIAMENT_RANKING_OVERVIEW); parliamentMenuItemFactory.createParliamentTopicMenu(parliamentMenuItem); final MenuItem politicianMenuItem = rankingsMenuItem.addItem(POLITICIAN_RANKING_LINK_TEXT,VaadinIcons.USER, COMMAND_POLITICIAN_RANKING_OVERVIEW); politicianRankingMenuItemFactory.createPoliticianRankingTopics(politicianMenuItem); final MenuItem partynMenuItem = rankingsMenuItem.addItem(PARTY_RANKING_LINK_TEXT, VaadinIcons.GROUP,COMMAND_PARTY_RANKING_OVERVIEW); partyRankingMenuItemFactory.createPartyRankingTopics(partynMenuItem); final MenuItem committeeMenuItem = rankingsMenuItem.addItem(COMMITTEE_RANKING_LINK_TEXT,VaadinIcons.GROUP, COMMAND_COMMITTEE_RANKING_OVERVIEW); committeeRankingMenuItemFactory.createCommitteeRankingTopics(committeeMenuItem); final MenuItem ministryMenuItem = rankingsMenuItem.addItem(MINISTRY_RANKING_LINK_TEXT,VaadinIcons.GROUP, COMMAND_MINISTRY_RANKING_OVERVIEW); ministryRankingMenuItemFactory.createMinistryRankingTopics(ministryMenuItem); final MenuItem govbodyMenuItem = rankingsMenuItem.addItem(GOVERNMENT_BODY_RANKING,VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODY_RANKING_OVERVIEW); governmentBodyRankingMenuItemFactory.createGovernmentBodyRankingTopics(govbodyMenuItem); final MenuItem documentsMenuItem = rankingsMenuItem.addItem(DOCUMENTS,VaadinIcons.GROUP, COMMAND_DOCUMENTS); documentsMenuItem.addItem("List all",VaadinIcons.GROUP, COMMAND_DOCUMENTS); documentsMenuItem.addItem(SEARCH_DOCUMENTS,VaadinIcons.GROUP, COMMAND_SEARCH_DOCUMENT); }
Example 12
Source File: AbstractMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
/** * Creates the admin menu. * * @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, VaadinIcons.SERVER, null); final MenuItem configurationMenuItem = adminMenuItem.addItem(CONFIGURATION, VaadinIcons.TOOLS, null); configurationMenuItem.addItem(APPLICATION_CONFIGURATION,VaadinIcons.TOOLS, COMMAND_APPLICATION_CONFIGURATION); configurationMenuItem.addItem(AGENCY,VaadinIcons.SERVER, COMMAND_AGENCY); configurationMenuItem.addItem(PORTAL, VaadinIcons.SITEMAP,COMMAND_PORTAL); configurationMenuItem.addItem(COUNTRY,VaadinIcons.FLAG, COMMAND_COUNTRY); configurationMenuItem.addItem(LANGUAGE,VaadinIcons.ACCESSIBILITY, COMMAND_LANGUAGE); configurationMenuItem.addItem(LANGUAGE_CONTENT,VaadinIcons.FILE_TEXT, COMMAND_LANGUAGE_CONTENT); final MenuItem managementMenuItem = adminMenuItem.addItem(MANAGEMENT, VaadinIcons.SERVER, null); managementMenuItem.addItem(AGENT_OPERATIONS_TEXT,VaadinIcons.BRIEFCASE, COMMAND_AGENT_OPERATION); managementMenuItem.addItem(DATA_SUMMARY_TEXT,VaadinIcons.DATABASE, COMMAND_DATASUMMARY); managementMenuItem.addItem(DATA_AUTHOR_SUMMARY,VaadinIcons.DATABASE, COMMAND_AUTHOR_DATASUMMARY); managementMenuItem.addItem(EMAIL,VaadinIcons.MAILBOX, COMMAND_EMAIL); managementMenuItem.addItem(SYSTEM_PERFORMANCE,VaadinIcons.DASHBOARD, COMMAND_MONITORING); final MenuItem userActivityMenuItem = adminMenuItem.addItem(USER_ACTIVITY, VaadinIcons.DATABASE, null); userActivityMenuItem.addItem(APPLICATION_SESSION,VaadinIcons.LAPTOP, COMMAND_APPLICATION_SESSION); userActivityMenuItem.addItem(APPLICATION_EVENT,VaadinIcons.ARROWS, COMMAND_APPLICATION_EVENTS); userActivityMenuItem.addItem(APPLICATION_EVENT_CHARTS,VaadinIcons.ARROWS, COMMAND_APPLICATION_EVENTS_CHARTS); userActivityMenuItem.addItem(USERACCOUNT,VaadinIcons.GROUP, COMMAND_USERACCOUNT); } }
Example 13
Source File: MinistryRankingMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void createMinistryRankingTopics(final MenuItem ministryMenuItem) { ministryMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, COMMAN_OVERVIEW); final MenuItem listByTopic = ministryMenuItem.addItem(RANKING_LIST_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); final MenuItem listItem = listByTopic.addItem(POLITICAL_WORK_SUMMARY_TEXT, VaadinIcons.GROUP, COMMAND_DATAGRID); listItem.setDescription(CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_TOTAL_POLTICIAL_DAYS_MEMBERSHIP_DESCRIPTION); final MenuItem chartByTopic = ministryMenuItem.addItem(CHART_BY_TOPIC_TEXT, VaadinIcons.GROUP, null); chartByTopic.addItem(CURRENT_MINISTRIES_CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_MINISTRIES_BY_HEADCOUNT); chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_MINISTRIES_HEAD_COUNT_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_PARTIES_BY_HEADCOUNT); chartByTopic.addItem(ALL_PARTIES_TOTAL_DAYS_SERVED_IN_MINISTRIES_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_ALLMINISTRIES_BY_TOTAL_DAYS); chartByTopic.addItem(ALL_MINISTRIES_TOTAL_MEMBERS_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_ALL_MINISTRIES_BY_HEADCOUNT); chartByTopic.addItem(GOVERNMENT_BODY_HEADCOUNT_PER_MINISTRY, VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODIES_HEADCOUNT); chartByTopic.addItem(GOVERNMENT_BODY_INCOME_PER_MINISTRY, VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODIES_INCOME); chartByTopic.addItem(GOVERNMENT_BODY_EXPENDITURE_PER_MINISTRY, VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODIES_EXPENDITURE); chartByTopic.addItem(GOVERNMENT_OUTCOME, VaadinIcons.GROUP, COMMAND_GOVERNMENT_OUTCOME); chartByTopic.addItem(GOVERNMENT_ROLES_CHART, VaadinIcons.GROUP, COMMAND_CHARTS_ALL_GOVERNMENT_ROLE_GANTT); ministryMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISITHISTORY); }
Example 14
Source File: CountryMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void createCountryTopicMenu(final MenuItem charts) { charts.addItem(OVERVIEW_TEXT, VaadinIcons.LINE_CHART, COMMAND_OVERVIEW); final MenuItem countryIndicators = charts.addItem(COUNTRY_INDICATORS_SWEDEN, VaadinIcons.LINE_CHART, null); addSourcesAndIndicatorsToMenu(countryIndicators, getTopicIndicatorMap()); charts.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.LINE_CHART, COMMAND_PAGEVISITHISTORY); }
Example 15
Source File: GovernmentBodyRankingMenuItemFactoryImpl.java From cia with Apache License 2.0 | 3 votes |
@Override public void createGovernmentBodyRankingTopics(final MenuItem ministryMenuItem) { ministryMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, COMMAN_OVERVIEW); ministryMenuItem.addItem(GOVERNMENT_BODIES, VaadinIcons.GROUP, COMMAND_DATAGRID); ministryMenuItem.addItem(HEADCOUNT, VaadinIcons.GROUP, COMMAND_HEADCOUNT); ministryMenuItem.addItem(INCOME, VaadinIcons.GROUP, COMMAND_INCOME); ministryMenuItem.addItem(EXPENDITURE, VaadinIcons.GROUP, COMMAND_EXPENDITURE); ministryMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISITHISTORY); }
Example 16
Source File: MinistryMenuItemFactoryImpl.java From cia with Apache License 2.0 | 2 votes |
@Override public void createMinistryMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); ministryRankingMenuItemFactory.createMinistryRankingTopics(menuBar.addItem(MINISTRY_RANKING, VaadinIcons.GROUP,null)); final MenuItem ministryItem = menuBar.addItem("Ministry "+ pageId, VaadinIcons.GROUP,null); ministryItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW, pageId)); final MenuItem rolesItem = ministryItem.addItem(ROLES_TEXT, VaadinIcons.GROUP, null); rolesItem.addItem(CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.CURRENTMEMBERS.toString(), pageId)); rolesItem.addItem(MEMBER_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.MEMBERHISTORY.toString(), pageId)); rolesItem.addItem(ROLE_GHANT_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.ROLEGHANT.toString(), pageId)); rolesItem.addItem(GOVERNMENT_BODIES_HEADCOUNT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.GOVERNMENT_BODIES_HEADCOUNT.toString(), pageId)); rolesItem.addItem(GOVERNMENT_BODIES_INCOME, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.GOVERNMENT_BODIES_INCOME.toString(), pageId)); rolesItem.addItem(GOVERNMENT_BODIES_EXPENDITURE, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.GOVERNMENT_BODIES_EXPENDITURE.toString(), pageId)); final MenuItem documentItem = ministryItem.addItem(DOCUMENTS_TEXT, VaadinIcons.GROUP, null); documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.DOCUMENTACTIVITY.toString(), pageId)); documentItem.addItem(DOCUMENT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, MinistryPageMode.DOCUMENTHISTORY.toString(), pageId)); ministryItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId)); }
Example 17
Source File: PoliticianMenuItemFactoryImpl.java From cia with Apache License 2.0 | 2 votes |
@Override public void createPoliticianMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); politicianRankingMenuItemFactory.createPoliticianRankingTopics(menuBar.addItem(POLITICIAN_RANKING, VaadinIcons.BUG, null)); final MenuItem politicanItem = menuBar.addItem("Politician "+ pageId, VaadinIcons.BUG,null); politicanItem.addItem(OVERVIEW_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.OVERVIEW, pageId)); politicanItem.addItem(INDICATORS_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.INDICATORS, pageId)); final MenuItem rolesItem = politicanItem.addItem(ROLES_TEXT, VaadinIcons.BUG, null); rolesItem.addItem(TOTAL_EXPERIENCE, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLESUMMARY.toString(), pageId)); rolesItem.addItem(ROLE_LIST, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLELIST.toString(), pageId)); rolesItem.addItem(ROLE_GHANT_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLEGHANT.toString(), pageId)); final MenuItem documentItem = politicanItem.addItem(DOCUMENTS_TEXT, VaadinIcons.BUG, null); documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTACTIVITY.toString(), pageId)); documentItem.addItem(DOCUMENT_HISTORY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTHISTORY.toString(), pageId)); final MenuItem ballotItem = politicanItem.addItem(BALLOTS_TEXT, VaadinIcons.BUG, null); ballotItem.addItem(VOTE_HISTORY, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.VOTEHISTORY.toString(), pageId)); ballotItem.addItem(BALLOT_DECISION_SUMMARY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.BALLOTDECISIONSUMMARY.toString(), pageId)); politicanItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.PAGEVISITHISTORY,pageId)); }
Example 18
Source File: PartyMenuItemFactoryImpl.java From cia with Apache License 2.0 | 2 votes |
@Override public void createPartyMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); partyRankingMenuItemFactory.createPartyRankingTopics(menuBar.addItem(PARTY_RANKING, VaadinIcons.GROUP,null)); final MenuItem partyItem = menuBar.addItem("Party "+ pageId, VaadinIcons.GROUP,null); partyItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.OVERVIEW, pageId)); final MenuItem rolesItem = partyItem.addItem(ROLES_TEXT, VaadinIcons.GROUP, null); rolesItem.addItem(CURRENT_LEADERS, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.CURRENTLEADERS.toString(), pageId)); rolesItem.addItem(LEADER_HISTORY, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.LEADERHISTORY.toString(), pageId)); rolesItem.addItem(CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.CURRENTMEMBERS.toString(), pageId)); rolesItem.addItem(MEMBER_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.MEMBERHISTORY.toString(), pageId)); rolesItem.addItem(GOVERMENT_ROLES, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.GOVERNMENTROLES.toString(), pageId)); rolesItem.addItem(COMMITTEE_ROLES, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEROLES.toString(), pageId)); rolesItem.addItem(ROLE_CHART_PARTY_LEADERS, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.ROLEGHANT.toString(), pageId)); final MenuItem documentItem = partyItem.addItem(DOCUMENTS_TEXT, VaadinIcons.GROUP, null); documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTACTIVITY.toString(), pageId)); documentItem.addItem(DOCUMENT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTHISTORY.toString(), pageId)); final MenuItem ballotItem = partyItem.addItem(BALLOTS_TEXT, VaadinIcons.GROUP, null); ballotItem.addItem(VOTE_HISTORY, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.VOTEHISTORY.toString(), pageId)); ballotItem.addItem(BALLOT_DECISION_SUMMARY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEBALLOTDECISIONSUMMARY.toString(), pageId)); ballotItem.addItem(PARTY_WON_DAILY_SUMMARY_CHART, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.PARTYWONDAILYSUMMARYCHART.toString(), pageId)); ballotItem.addItem(PartyPageMode.PARTYAGAINSTCOALATIONSSUMMARY.toString(), VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.PARTYAGAINSTCOALATIONSSUMMARY.toString(), pageId)); ballotItem.addItem(PartyPageMode.PARTYSUPPORTSUMMARY.toString(), VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.PARTYSUPPORTSUMMARY.toString(), pageId)); partyItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId)); }
Example 19
Source File: CommitteeMenuItemFactoryImpl.java From cia with Apache License 2.0 | 2 votes |
@Override public void createCommitteeeMenuBar(final MenuBar menuBar, final String pageId) { initApplicationMenuBar(menuBar); applicationMenuItemFactory.addRankingMenu(menuBar); committeeRankingMenuItemFactory.createCommitteeRankingTopics(menuBar.addItem(COMMITTEE_RANKING_TEXT, VaadinIcons.GROUP, null)); final MenuItem committeeItem = menuBar.addItem("Committee "+ pageId, VaadinIcons.GROUP,null); committeeItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, PageMode.OVERVIEW, pageId)); final MenuItem rolesItem = committeeItem.addItem(ROLES_TEXT, VaadinIcons.GROUP, null); rolesItem.addItem(CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.CURRENT_MEMBERS.toString(), pageId)); rolesItem.addItem(MEMBER_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.MEMBERHISTORY.toString(), pageId)); rolesItem.addItem(ROLE_GHANT_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.ROLEGHANT.toString(), pageId)); final MenuItem documentItem = committeeItem.addItem(DOCUMENTS_TEXT, VaadinIcons.GROUP, null); documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.DOCUMENTACTIVITY.toString(), pageId)); documentItem.addItem(DOCUMENT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.DOCUMENT_HISTORY.toString(), pageId)); final MenuItem ballotItem = committeeItem.addItem(BALLOTS_TEXT, VaadinIcons.GROUP, null); ballotItem.addItem(BALLOT_DECISION_SUMMARY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.BALLOTDECISIONSUMMARY.toString(), pageId)); ballotItem.addItem(DECISION_SUMMARY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.DECISIONSUMMARY.toString(), pageId)); ballotItem.addItem(DECISION_TYPE_DAILY_SUMMARY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand( UserViews.COMMITTEE_VIEW_NAME, CommitteePageMode.DECISIONTYPEDAILYSUMMARY.toString(), pageId)); ballotItem.addItem("Decision flow", VaadinIcons.GROUP, new PageModeMenuCommand( UserViews.COMMITTEE_VIEW_NAME, PageMode.CHARTS+"/"+ ChartIndicators.DECISION_FLOW_CHART, pageId)); committeeItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId)); }