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


Java MenuBar.addItem方法代码示例

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


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

示例1: CategoriesMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public CategoriesMenu() {
	toolBarOption = new ToolBarOption();
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	dirMenu = new MenuBar(true);
	create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder);
	create.addStyleName("okm-MenuItem");
	dirMenu.addItem(create);
	rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder);
	rename.addStyleName("okm-MenuItem-strike");
	dirMenu.addItem(rename);
	move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder);
	move.addStyleName("okm-MenuItem");
	dirMenu.addItem(move);
	dirMenu.setStyleName("okm-MenuBar");
	export = new MenuItem(Util.menuHTML("img/icon/actions/export.gif", Main.i18n("tree.menu.export")), true, exportToFile);
	export.addStyleName("okm-MenuItem-strike");
	dirMenu.addItem(export);
	initWidget(dirMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:22,代码来源:CategoriesMenu.java

示例2: FindToolBarMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * ResizeToolBarMenu
 */
public FindToolBarMenu() {
	// Establishes auto-close when click outside
	super(true, true);
	toolBarOption = new ToolBarOption();

	dirMenu = new MenuBar(true);
	dirMenu.setStyleName("okm-SubMenuBar");
	findFolder = new MenuItem(Util.menuHTML("img/icon/actions/folder_find.gif", Main.i18n("general.menu.file.find.folder")), true, findFolderOKM);
	findDocument = new MenuItem(Util.menuHTML("img/icon/actions/document_find.png", Main.i18n("general.menu.file.find.document")), true, findDocumentOKM);
	findSimilarDocument = new MenuItem(Util.menuHTML("img/icon/actions/similar_find.png", Main.i18n("general.menu.file.find.similar.document")), true, findSimilarOKM);

	dirMenu.addItem(findFolder);
	dirMenu.addItem(findDocument);
	dirMenu.addItem(findSimilarDocument);

	setWidget(dirMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:21,代码来源:FindToolBarMenu.java

示例3: Menu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * Browser menu
 */
public Menu() {
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	searchSavedMenu = new MenuBar(true);
	run = new MenuItem(Util.menuHTML("img/icon/actions/run.gif", Main.i18n("search.saved.run")), true, runSearch);
	run.addStyleName("okm-MenuItem");
	searchSavedMenu.addItem(run);
	delete = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("search.saved.delete")), true, deleteSearch);
	delete.addStyleName("okm-MenuItem");
	searchSavedMenu.addItem(delete);
	share = new MenuItem(Util.menuHTML("img/icon/actions/share_query.gif", GeneralComunicator.i18nExtension("messaging.share.query")), true, shareSearch);
	share.addStyleName("okm-MenuItem");
	searchSavedMenu.addStyleName("okm-MenuBar");
	initWidget(searchSavedMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:20,代码来源:Menu.java

示例4: Menu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * Browser menu
 */
public Menu() {
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	searchMenu = new MenuBar(true);
	download = new MenuItem(Util.menuHTML("img/icon/actions/download.gif", Main.i18n("search.result.menu.download")), true, downloadFile);
	download.addStyleName("okm-MenuItem");
	go = new MenuItem(Util.menuHTML("img/icon/actions/goto_folder.gif", Main.i18n("search.result.menu.go.folder")), true, goDirectory);
	go.addStyleName("okm-MenuItem");
	findSimilarDocument = new MenuItem(Util.menuHTML("img/icon/actions/similar_find.png", Main.i18n("general.menu.file.find.similar.document")), true, findSimilarOKM);
	findSimilarDocument.addStyleName("okm-MenuItem");

	searchMenu.addItem(download);
	searchMenu.addItem(go);
	searchMenu.addItem(findSimilarDocument);
	searchMenu.setStyleName("okm-MenuBar");

	initWidget(searchMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:23,代码来源:Menu.java

示例5: Menu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * Browser menu
 */
public Menu() {
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	mailMenu = new MenuBar(true);
	all = new MenuItem(Util.menuHTML("img/icon/actions/select_all.png", Main.i18n("mail.menu.show.all")), true, commandShowAll);
	all.addStyleName("okm-MenuItem");
	mailMenu.addItem(all);
	cc = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.cc")), true, commandShowCC);
	cc.addStyleName("okm-MenuItem");
	mailMenu.addItem(cc);
	bcc = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.bcc")), true, commandShowBCC);
	bcc.addStyleName("okm-MenuItem");
	mailMenu.addItem(bcc);
	reply = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.reply")), true, commandShowReply);
	reply.addStyleName("okm-MenuItem");
	mailMenu.addItem(reply);
	extra = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.extre")), true, commandShowExtra);
	extra.addStyleName("okm-MenuItem");
	mailMenu.addItem(extra);
	mailMenu.addStyleName("okm-MenuBar");
	initWidget(mailMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:27,代码来源:Menu.java

示例6: createOntologyMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
private void createOntologyMenu(List<Term> terms) {
	MenuBar menu = new MenuBar(true);
	menu.setAnimationEnabled(true);
	
	for(final Term term : terms) {
		Ontology ontology = term.getOntology();
		if(!ontology.isCodelist()) {
			menu.addItem(ontology.getName(), new Command() {
				public void execute() {
					History.newItem(term.getReferenceId());
				}
			});
		}
	}
			
	menuBar.insertItem(new MenuItem("Ontology", menu), 0);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:18,代码来源:OntoBrowser.java

示例7: MenuPopup

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public MenuPopup(List<MenuPopupItem> items) {
	super(false, Type.MENU);
	MenuBar popupMenuBar = new MenuBar(true);

	for (final MenuPopupItem item : items) {
		popupMenuBar.addItem(new MenuItem(item.getText(), true, new ScheduledCommand() {
			@Override
			public void execute() {
				item.execute();
				hide();
			}
		}));
	}
	popupMenuBar.setVisible(true);
	add(popupMenuBar);
}
 
开发者ID:umlet,项目名称:umlet,代码行数:17,代码来源:MenuPopup.java

示例8: processMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
private static void processMenu(MenuBar menu, MenuItemGVO[] subMenus, String name, String uuid, String parent) {
	MenuBar subMenu = new MenuBar(true);
	for (int j = 0; j < subMenus.length; j++) {
		if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
			processMenu(subMenu, subMenus[j].getSubMenus(), subMenus[j].getDisplayname(), uuid, parent);
		} else {
			if (subMenus[j] instanceof MenuItemSeparatorGVO) {
				menu.addSeparator();
			} else {
				MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(), (Command) null);
				RendererHelper.fillIn(subMenus[j], menuItem, uuid, parent, subMenus[j].getContext());
				subMenu.addItem(menuItem);
			}
		}
	}
	if (tempString.equals(name)) {
		contextMenu.addItem(new MenuItem(name, subMenu));
	} else {
		menu.addItem(new MenuItem(name, subMenu));
	}
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:22,代码来源:AbstractComponentRenderer.java

示例9: addMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public static void addMenu(ComponentGVO vo, UIObject ui, String uuid, String parent) {
	if (vo != null && ui != null) {
		if (vo.getMenu() != null) {
			MenuBar menu = new MenuBar();
			menu.setAutoOpen(true);
			menu.setWidth("100%");
			UIObject renderedComponent = new MenuItemRenderer().render(vo.getMenu(), uuid, parent, vo.getContext());
			if (renderedComponent instanceof MenuBar) {
				menu.addItem(vo.getMenu().getDisplayname(), (MenuBar) renderedComponent);
			} else if (renderedComponent instanceof MenuItem) {
				menu.addItem((MenuItem) renderedComponent);
			}
			if (ui instanceof DockPanel) {
				((DockPanel) ui).add(menu, DockPanel.NORTH);
			} else if (ui instanceof Grid || ui instanceof VerticalPanel || ui instanceof HorizontalPanel)
				((Panel) ui).add(menu);
		}
	}

}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:21,代码来源:RendererHelper.java

示例10: processMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
private void processMenu(MenuBar menu, MenuItemGVO subMenuGVO, String name, String uuid, String parent) {
	MenuBar subMenu = new MenuBar(true);
	MenuItemGVO[] subMenus = subMenuGVO.getSubMenus();
	for (int j = 0; j < subMenus.length; j++) {
		if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
			processMenu(subMenu, subMenus[j], subMenus[j].getDisplayname(), uuid,parent);
		} else {
			if (subMenus[j] instanceof MenuItemSeparatorGVO){					
				subMenu.addSeparator();
			} else {
				MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(),(Command) null);
				RendererHelper.fillIn(subMenus[j], menuItem, uuid,parent, subMenus[j].getContext());
				subMenu.addItem(menuItem);
			}
		}

	}
	MenuItem subMenuItem = new MenuItem(name, subMenu);
	RendererHelper.fillIn(subMenuGVO, subMenuItem, uuid,parent, subMenuGVO.getContext());
	menu.addItem(subMenuItem);
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:22,代码来源:WindowRenderer.java

示例11: addMenu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public static void addMenu(ComponentGVO vo, UIObject ui, String uuid, String parent) {
	if (vo != null && ui != null) {
		if (vo.getMenu() != null) {
			MenuBar menu = new MenuBar();
			menu.setAutoOpen(true);
			menu.setWidth("100%");
			UIObject renderedComponent = new MenuItemRenderer().render(vo.getMenu(), null, uuid, parent, vo.getContext(), null);
			if (renderedComponent instanceof MenuBar) {
				menu.addItem(vo.getMenu().getDisplayname(), (MenuBar) renderedComponent);
			} else if (renderedComponent instanceof MenuItem) {
				menu.addItem((MenuItem) renderedComponent);
			}
			if (ui instanceof DockPanel) {
				((DockPanel) ui).add(menu, DockPanel.NORTH);
			} else if (ui instanceof Grid || ui instanceof VerticalPanel || ui instanceof HorizontalPanel)
				((Panel) ui).add(menu);
		}
	}

}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:21,代码来源:RendererHelper.java

示例12: NewConnectionPanel

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public NewConnectionPanel() {
	super(true,true);
	newConnectionMenu = new MenuBar(true);
	newConnectionMenu.addItem(appConstants.modelBiDirection(),new Command() {
		public void execute() {
			addNewConnection(selectedWidget,selectedWidget2,true);
			NewConnectionPanel.this.hide();
		}
	});
	newConnectionMenu.addItem(appConstants.modelToHere(),new Command() {
		public void execute() {
			addNewConnection(selectedWidget,selectedWidget2,false);
			NewConnectionPanel.this.hide();
		}
	});
	newConnectionMenu.addItem(appConstants.modelFromHere(),new Command() {
		public void execute() {
			addNewConnection(selectedWidget2,selectedWidget,false);
			NewConnectionPanel.this.hide();
		}
	});
	add(newConnectionMenu);
}
 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:24,代码来源:ParagraphsMapEditor.java

示例13: PlaceholderContextMenuWidget

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
public PlaceholderContextMenuWidget(Command bringToFrontCommand, Command bringForwardCommand, Command sendBackwardCommand,
										Command sendToBackCommand, Command propertiesCommand, Command deleteCommand) {
	super(true, false);
	MenuBar popupMenuBar = new MenuBar(true);
	
	MenuItem propertiesItem = new MenuItem("Properties", true, propertiesCommand);
	MenuItem deleteItem = new MenuItem("Delete", true, deleteCommand);
	MenuItem bringToFrontItem = new MenuItem("Bring to Front", true, bringToFrontCommand);
	MenuItem bringForwardItem = new MenuItem("Bring Forward", true, bringForwardCommand);
	MenuItem sendBackwardItem = new MenuItem("Send Backward", true, sendBackwardCommand);
	MenuItem sendToBackItem = new MenuItem("Send to Back", true, sendToBackCommand);
	
	popupMenuBar.addItem(propertiesItem);
	popupMenuBar.addItem(deleteItem);
	popupMenuBar.addSeparator();
	popupMenuBar.addItem(bringToFrontItem);
	popupMenuBar.addItem(bringForwardItem);
	popupMenuBar.addItem(sendBackwardItem);
	popupMenuBar.addItem(sendToBackItem);

   	popupMenuBar.setVisible(true);
   	add(popupMenuBar);
   	
	sinkEvents(Event.ONCONTEXTMENU); 
}
 
开发者ID:Rise-Vision,项目名称:rva,代码行数:26,代码来源:PlaceholderContextMenuWidget.java

示例14: Menu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * Browser menu
 */
public Menu() {
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	menu = new MenuBar(true);

	delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deletePropose);
	delete.addStyleName("okm-MenuItem");
	menu.addItem(delete);
	menu.setStyleName("okm-MenuBar");
	initWidget(menu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:16,代码来源:Menu.java

示例15: Menu

import com.google.gwt.user.client.ui.MenuBar; //导入方法依赖的package包/类
/**
 * Browser menu
 */
public Menu() {
	// The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected

	// First initialize language values
	menu = new MenuBar(true);

	delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deleteMessageSent);
	delete.addStyleName("okm-MenuItem");
	menu.addItem(delete);
	menu.setStyleName("okm-MenuBar");
	initWidget(menu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:16,代码来源:Menu.java


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