当前位置: 首页>>代码示例>>Java>>正文


Java MenuItem.setDescription方法代码示例

本文整理汇总了Java中com.vaadin.ui.MenuBar.MenuItem.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java MenuItem.setDescription方法的具体用法?Java MenuItem.setDescription怎么用?Java MenuItem.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.MenuBar.MenuItem的用法示例。


在下文中一共展示了MenuItem.setDescription方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMenuItem

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
/**
 * @param actionGroup
 * @param menuItemByGroupName
 * @return
 */
private MenuItem createMenuItem(JNActionGroup actionGroup, Map<String, MenuItem> menuItemByGroupName) {
	MenuItem menuItem = null;
	MenuItem parentItem = null;
	if (StringHelper.isNotEmptyWithTrim(actionGroup.parent())) {
		parentItem = menuItemByGroupName.get(actionGroup.parent());

		if (parentItem == null) {
			JNActionGroup parentActionGroup = actionGroupByName.get(actionGroup.parent());
			if (parentActionGroup != null) {
				parentItem = createMenuItem(parentActionGroup, menuItemByGroupName);
				menuItemByGroupName.put(parentActionGroup.name(), parentItem);
			}
		}
	}

	menuItem = parentItem == null ? menuBar.addItem(actionGroup.name(), null) : parentItem.addItem(actionGroup.name(), null);
	findNAddIcon(actionGroup.icon(), menuItem);

	if (StringHelper.isNotEmptyWithTrim(actionGroup.description()))
		menuItem.setDescription(actionGroup.description());

	if (StringHelper.isNotEmptyWithTrim(actionGroup.style()))
		menuItem.setStyleName(actionGroup.style());
	return menuItem;
}
 
开发者ID:lkumarjain,项目名称:jain-I18n,代码行数:31,代码来源:ActionMenuBar.java

示例2: processAction

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
/**
 * @param parentItem
 * @param first
 * @param style
 * @param i
 * @param action
 * @return
 */
private MenuItem processAction(MenuItem parentItem, String first, String style, int i, JNAction action) {
	MenuItem lastItem;
	lastItem = parentItem == null ? menuBar.addItem(actionsToName.get(action), listener) : parentItem.addItem(actionsToName.get(action), listener);

	findNAddIcon(action.icon(), lastItem);
	lastItem.setVisible(validatePermission (action));

	if (StringHelper.isNotEmptyWithTrim(action.description()))
		lastItem.setDescription(action.description());
	else
		lastItem.setDescription(actionsToName.get(action));

	if (i == 0)
		lastItem.setStyleName(first);
	else 
		lastItem.setStyleName(style);

	if (action.separator() && parentItem != null) {
		parentItem.addSeparator();
	}
	return lastItem;
}
 
开发者ID:lkumarjain,项目名称:jain-I18n,代码行数:31,代码来源:ActionMenuBar.java

示例3: createPartyRankingTopics

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
@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);
}
 
开发者ID:Hack23,项目名称:cia,代码行数:30,代码来源:PartyRankingMenuItemFactoryImpl.java

示例4: addMenuItem

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
@Override
public MenuItem addMenuItem(String caption, String hint, MenuItem menuItem, Command command) {
	MenuItem itm = menuItem.addItem(caption, command);
	itm.setDescription(hint);
	
	return itm;
	
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:9,代码来源:MenuLayout.java

示例5: createCommitteeRankingTopics

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
/**
 * 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);

}
 
开发者ID:Hack23,项目名称:cia,代码行数:28,代码来源:CommitteeRankingMenuItemFactoryImpl.java

示例6: createPoliticianRankingTopics

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
@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);

}
 
开发者ID:Hack23,项目名称:cia,代码行数:19,代码来源:PoliticianRankingMenuItemFactoryImpl.java

示例7: createMinistryRankingTopics

import com.vaadin.ui.MenuBar.MenuItem; //导入方法依赖的package包/类
@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_BODIES, VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODIES);

	chartByTopic.addItem(GOVERNMENT_ROLES_CHART, VaadinIcons.GROUP, COMMAND_CHARTS_ALL_GOVERNMENT_ROLE_GANTT);

	ministryMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISITHISTORY);

}
 
开发者ID:Hack23,项目名称:cia,代码行数:26,代码来源:MinistryRankingMenuItemFactoryImpl.java


注:本文中的com.vaadin.ui.MenuBar.MenuItem.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。