Java Code Examples for com.vaadin.ui.MenuBar.MenuItem#setDescription()
The following examples show how to use
com.vaadin.ui.MenuBar.MenuItem#setDescription() .
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: 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 2
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 3
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 4
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 5
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); }