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


Java MenuManager.setRemoveAllWhenShown方法代码示例

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


在下文中一共展示了MenuManager.setRemoveAllWhenShown方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 NOT
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

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

示例2: 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,代码来源:RecipeEditor.java

示例3: 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 NOT
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

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

示例4: 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 -->
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" );
    contextMenu.add ( new Separator ( "additions" ) );
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( this.editingDomain, viewer ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:ChartConfiguratorView.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:polarsys,项目名称:time4sys,代码行数:21,代码来源:TraceEditor.java

示例6: registerContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private void registerContextMenu() {
  final MenuManager contextMenu = new MenuManager();
  contextMenu.setRemoveAllWhenShown(true);
  this.getSite().registerContextMenu(contextMenu, ContextualView.treeViewer);
  // Add in the entries for all markers views if this has a different if
  if (!this.getSite().getId().equals(ContextualView.MARKERS_ID)) {
    this.getSite().registerContextMenu(ContextualView.MARKERS_ID, contextMenu, ContextualView.treeViewer);
  }
  final Control control = ContextualView.treeViewer.getControl();
  final Menu menu = contextMenu.createContextMenu(control);
  control.setMenu(menu);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:13,代码来源:ContextualView.java

示例7: createDataModelTableViewer

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
/**
 * Create a new {@link TableViewer} with {@link DataModel} elements.
 * 
 * @param site The {@link IWorkbenchPartSite} used to register the table's context menu.
 * @param table The {@link Table}.
 * @param dataModelClass The {@link DataModel} element {@link Class}.
 * @param dataModelElementType The {@link DataModel} {@link IElementType}.
 * @param input The {@link TableViewer} input.
 * @param inputElementType The input {@link IElementType}.
 * @return A new {@link TableViewer}.
 */
public static TableViewer createDataModelTableViewer(IWorkbenchPartSite site, Table table, Class<?> dataModelClass,
        final IElementType dataModelElementType, Object input, IElementType inputElementType) {

    TableViewer tableViewer = createTableViewer(table, dataModelClass, dataModelElementType, input,
            inputElementType, new DataModelElementBinding());

    List<BaseAction> tableActions = dataModelElementType.getActions();
    if (tableActions != null) {
        for (BaseAction action : tableActions) {
            action.setSelectionProvider(tableViewer);
        }

        MenuManager menuManager = new MenuManager("#PopupMenu");
        menuManager.setRemoveAllWhenShown(true);
        menuManager.addMenuListener(new IMenuListener() {

            public void menuAboutToShow(IMenuManager manager) {
                dataModelElementType.fillContextMenu(manager);
            }

        });

        Menu menu = menuManager.createContextMenu(table);
        table.setMenu(menu);
        site.registerContextMenu(menuManager, tableViewer);
    }

    return tableViewer;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:41,代码来源:ViewerFactory.java

示例8: configurePopupMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
protected void configurePopupMenu(final PopupMenuConfiguration popupMenuConfiguration) {
	MenuManager mgr = new MenuManager();
       mgr.setRemoveAllWhenShown(true);
       mgr.addMenuListener(new IMenuListener() {
		
		@Override
		public void menuAboutToShow(IMenuManager manager) {
			popupMenuConfiguration.fillPopupMenu(manager, SchemaViewer.this);
		}
	});           
       Menu menu = mgr.createContextMenu(treeViewer.getControl());
       treeViewer.getControl().setMenu(menu);
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:14,代码来源:SchemaViewer.java

示例9: hookContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private void hookContextMenu ( final IViewSite viewSite )
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( this.viewer.getControl () );
    this.viewer.getControl ().setMenu ( menu );
    viewSite.registerContextMenu ( menuMgr, this.viewer );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:InformationViewPart.java

示例10: hookContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
private void hookContextMenu ( final IEditorSite editorSite )
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( this.viewer.getControl () );
    this.viewer.getControl ().setMenu ( menu );
    editorSite.registerContextMenu ( menuMgr, this.viewer );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:BasicEditor.java

示例11: hookContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
protected void hookContextMenu ( final Control control, final ISelectionProvider selectionProvider, final IViewSite viewSite )
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( control );
    control.setMenu ( menu );
    viewSite.registerContextMenu ( menuMgr, selectionProvider );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:EventViewTable.java

示例12: hookContextMenu

import org.eclipse.jface.action.MenuManager; //导入方法依赖的package包/类
protected void hookContextMenu() {
	MenuManager menuMgr = new MenuManager("#PopupMenu");
	menuMgr.setRemoveAllWhenShown(true);
	menuMgr.addMenuListener(new IMenuListener() {
		public void menuAboutToShow(IMenuManager manager) {
			preferenceView.fillContextMenu(manager);
		}
	});
	Menu menu = menuMgr.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	preferenceView.getSite().registerContextMenu(menuMgr, viewer);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:13,代码来源:ViewerPage.java


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