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


Java MenuManager.add方法代码示例

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


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

示例1: createContextMenuFor

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor ( StructuredViewer viewer )
{
    MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ProtocolEditor.java

示例2: createViewMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private void createViewMenu(MenuManager menuManager) {
	MenuManager viewMenu = createMenu(menuManager, MenuConstants.VIEW);
	menuManager.add(viewMenu);
	viewMenu.setVisible(true);

	if (actionFactory == null) {
		actionFactory = new ActionFactory(this);
	}
	
	viewMenu.add(actionFactory.getAction(GridViewAction.class.getName()));
	viewMenu.add(actionFactory.getAction(FormattedViewAction.class.getName()));
	viewMenu.add(actionFactory.getAction(UnformattedViewAction.class.getName()));
	viewMenu.add(new Separator());
	viewMenu.add(actionFactory.getAction(ReloadAction.class.getName()));
	viewDataPreferencesVO = getViewDataPreferencesFromPreferenceFile();
	viewMenu.add(actionFactory.getAction(PreferencesAction.class.getName()));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:DebugDataViewer.java

示例3: createTextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
/**
 * Create the context menu for the text widget.
 * 
 * @since 3.4
 */
private void createTextMenu() {
	final MenuManager textManager = new MenuManager();
	textManager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
			null, IWorkbenchCommandConstants.EDIT_COPY, CommandContributionItem.STYLE_PUSH)));
	textManager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
			null, IWorkbenchCommandConstants.EDIT_SELECT_ALL, CommandContributionItem.STYLE_PUSH)));
	text.setMenu(textManager.createContextMenu(text));
	text.addDisposeListener(new DisposeListener() {

		public void widgetDisposed(DisposeEvent e) {
			textManager.dispose();
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:CustomAboutDialog.java

示例4: fillContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
@Override
public void fillContextMenu(final IMenuManager menu) {
	super.fillContextMenu(menu);

	final ISelection selection = getContext().getSelection();
	if (selection instanceof IStructuredSelection) {
		if (canEnable((IStructuredSelection) selection)) {
			final MenuManager newMenu = new MenuManager("Ne&w");
			menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
			newMenu.add(getNewWizardMenu());
		}
	}

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:N4JSNewWizardsActionGroup.java

示例5: createContextMenuFor

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor(StructuredViewer viewer) {
	MenuManager contextMenu = new MenuManager("#PopUp");
	contextMenu.add(new Separator("additions"));
	contextMenu.setRemoveAllWhenShown(true);
	contextMenu.addMenuListener(this);
	Menu menu= contextMenu.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));

	int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
	Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
	viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
	viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:21,代码来源:PlatformEditor.java

示例6: createDataMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private void createDataMenu(MenuManager menuManager) {
	MenuManager dataMenu = createMenu(menuManager, MenuConstants.Data);
	menuManager.add(dataMenu);
	dataMenu.setVisible(true);

	if (actionFactory == null) {
		actionFactory = new ActionFactory(this);
	}
	
	dataMenu.add(actionFactory.getAction(ResetSortAction.class.getName()));
	dataMenu.add(actionFactory.getAction(FilterAction.class.getName()));
	dataMenu.add(actionFactory.getAction(ClearFilterAction.class.getName()));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:DebugDataViewer.java

示例7: createMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private MenuManager createMenu(MenuManager menuManager, String menuName) {
	MenuManager menu = new MenuManager(menuName);
	menuManager.add(menu);
	menuManager.setVisible(true);
	return menu;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:7,代码来源:DebugDataViewer.java


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