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


Java MenuBar类代码示例

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


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

示例1: UniTimeTableHeader

import com.google.gwt.user.client.ui.MenuBar; //导入依赖的package包/类
public UniTimeTableHeader(String title, int colSpan, HorizontalAlignmentConstant align) {
	super(title, false);
	iColSpan = colSpan;
	iAlign = align;
	iTitle = title;
	
	addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			final PopupPanel popup = new PopupPanel(true);
			popup.addStyleName("unitime-Menu");
			if (!setMenu(popup)) return;
			popup.showRelativeTo((Widget)event.getSource());
			((MenuBar)popup.getWidget()).focus();
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:UniTimeTableHeader.java

示例2: TrashMenu

import com.google.gwt.user.client.ui.MenuBar; //导入依赖的package包/类
public TrashMenu() {
	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);
	restore = new MenuItem(Util.menuHTML("img/icon/actions/restore.gif", Main.i18n("general.menu.file.restore")), true, restoreFolder);
	restore.addStyleName("okm-MenuItem");
	dirMenu.addItem(restore);
	purge = new MenuItem(Util.menuHTML("img/icon/actions/purge.gif", Main.i18n("general.menu.file.purge")), true, purgeFolder);
	purge.addStyleName("okm-MenuItem");
	dirMenu.addItem(purge);
	purgeTrash = new MenuItem(Util.menuHTML("img/icon/actions/purge_trash.gif", Main.i18n("general.menu.file.purge.trash")), true, purgeTrashFolder);
	purgeTrash.addStyleName("okm-MenuItem");
	dirMenu.addItem(purgeTrash);
	dirMenu.setStyleName("okm-MenuBar");
	initWidget(dirMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:19,代码来源:TrashMenu.java

示例3: MailMenu

import com.google.gwt.user.client.ui.MenuBar; //导入依赖的package包/类
public MailMenu() {
	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);
	remove = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("tree.menu.directory.remove")), true, delFolder);
	remove.addStyleName("okm-MenuItem-strike");
	dirMenu.addItem(remove);
	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);
	copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("tree.menu.directory.copy")), true, copyFolder);
	copy.addStyleName("okm-MenuItem");
	dirMenu.addItem(copy);
	dirMenu.setStyleName("okm-MenuBar");
	initWidget(dirMenu);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:25,代码来源:MailMenu.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: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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