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


Java MHandledMenuItem类代码示例

本文整理汇总了Java中org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem的典型用法代码示例。如果您正苦于以下问题:Java MHandledMenuItem类的具体用法?Java MHandledMenuItem怎么用?Java MHandledMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createViewMenu

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
private void createViewMenu() {


		MHandledToolItem clearAllButton = modelService.createModelElement(MHandledToolItem.class);
		clearAllButton.setIconURI(CLEAR_ALL_ICON_URI);
		clearAllButton.setCommand(clearAllCommand);

		MToolBar toolBar = modelService.createModelElement(MToolBar.class);
		toolBar.getChildren().add(clearAllButton);
		part.setToolbar(toolBar);

		MHandledMenuItem clearAllMenuItem = modelService.createModelElement(MHandledMenuItem.class);
		clearAllMenuItem.setLabel("Clear All"); //$NON-NLS-1$
		clearAllMenuItem.setIconURI(CLEAR_ALL_ICON_URI);
		clearAllMenuItem.setCommand(clearAllCommand);

		MHandledMenuItem preferencesMenuItem = modelService.createModelElement(MHandledMenuItem.class);
		preferencesMenuItem.setLabel("Preferences"); //$NON-NLS-1$
		preferencesMenuItem.setCommand(showPreferencesCommand);

		MMenu menu = modelService.createModelElement(MMenu.class);
		menu.getTags().add("ViewMenu"); // required //$NON-NLS-1$
		menu.getChildren().add(clearAllMenuItem);
		menu.getChildren().add(preferencesMenuItem);

		part.getMenus().add(menu);

	}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:29,代码来源:ProgrammaticProgressView.java

示例2: newFilterMenuItem

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
private MHandledMenuItem newFilterMenuItem(String key) {
	MHandledMenuItem menuItem = MMenuFactory.INSTANCE.createHandledMenuItem();
	menuItem.setElementId("org.bbaw.bts.ui.corpus.part.annotations.viewmenu.showType.annotation.type." + key);
	menuItem.setSelected(true);
	menuItem.setType(ItemType.CHECK);
	MParameter menuFilterParam = MCommandsFactory.INSTANCE.createParameter();
	menuFilterParam.setName("annotationsPartFilterParam");
	menuFilterParam.setValue(key);
	menuItem.getParameters().add(menuFilterParam);
	return menuItem;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:AnnotationsPart.java

示例3: testStartLaunchConfigMenuContribution

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
@Test
public void testStartLaunchConfigMenuContribution() {
  List<MMenuContribution> menuContributions = application.getMenuContributions();
  MHandledMenuItem element = menuContributions.stream()
    .flatMap( menuContribution -> menuContribution.getChildren().stream() )
    .filter( menuElement -> MENU_ITEM_ID.equals( menuElement.getElementId() ) )
    .findFirst()
    .map( MHandledMenuItem.class::cast )
    .orElse( null );

  assertThat( element.getIconURI() ).endsWith( Images.START_LAUNCH_CONFIGURATION );
  assertThat( element.getLabel() ).isNotEmpty();
  assertThat( element.getCommand().getElementId() ).isEqualTo( OpenLaunchDialogHander.COMMAND_ID );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:15,代码来源:StartLaunchConfigMenuPDETest.java

示例4: canExecute

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
@CanExecute
public boolean canExecute(MHandledMenuItem item) {
	CommandActivator activator = activated.get(getClass());
	if (activator == null)
		return false;
	if ((activator.getStyle() & (SWT.CHECK | SWT.RADIO)) != 0)
		item.setSelected(activator.getSelection());
	return activator.getEnabled();
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:10,代码来源:MenuItemWithToolbar.java

示例5: getMenuItem

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
private MHandledMenuItem getMenuItem(final String inItemID,
        final MApplication inApplication, final EModelService inModel) {
	if (menuItem == null) {
		menuItem = findMenuItem(inItemID, inApplication, inModel);
	}
	return menuItem;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:8,代码来源:PopupHelper.java

示例6: findMenuItem

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
private MHandledMenuItem findMenuItem(final String inItemID,
        final MMenu inMenu) {
	inMenu.getChildren();
	for (final MMenuElement lItem : inMenu.getChildren()) {
		if (inItemID.equals(lItem.getElementId())) {
			return (MHandledMenuItem) lItem;
		}
	}
	return null;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:11,代码来源:PopupHelper.java

示例7: canExecute

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
public boolean canExecute(MHandledMenuItem item) {
	if (super.canExecute(item))
		return true;
	return isWebSite();
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:6,代码来源:EditMenuItemBrowser.java

示例8: canExecute

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
public boolean canExecute(MHandledMenuItem item) {
	return super.canExecute(item) && isThereSomethingToPaste();
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:4,代码来源:Paste.java

示例9: canExecute

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
@CanExecute
public boolean canExecute(MHandledMenuItem item) {
	if (super.canExecute(item))
		return true;
	return (getMethod("selectAll") != null && getMethod("cut") != null);
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:7,代码来源:Clear.java

示例10: canExecute

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
@CanExecute
public boolean canExecute(MHandledMenuItem item) {
	if (super.canExecute(item))
		return true;
	return getDefaultMethod() != null;
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:7,代码来源:EditMenuItem.java

示例11: setSelected

import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; //导入依赖的package包/类
/**
 * Sets the item with the specified ID' toggle state.
 * 
 * @param inItemID
 *            String
 * @param inState
 *            boolean
 * @param inApplication
 *            {@link MApplication}
 * @param inModel
 *            {@link EModelService}
 */
public void setSelected(final String inItemID, final boolean inState,
        final MApplication inApplication, final EModelService inModel) {
	final MHandledMenuItem lItem = getMenuItem(inItemID, inApplication,
	        inModel);
	if (lItem != null) {
		lItem.setSelected(inState);
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:21,代码来源:PopupHelper.java


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