Runtime

org.eclipse.gmf.runtime.diagram.ui.providers
Class DiagramContextMenuProvider

java.lang.Object
  extended byorg.eclipse.jface.action.ContributionManager
      extended byorg.eclipse.jface.action.MenuManager
          extended byorg.eclipse.gef.ContextMenuProvider
              extended byorg.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider
All Implemented Interfaces:
IContributionItem, IContributionManager, IMenuListener, IMenuManager

public class DiagramContextMenuProvider
extends ContextMenuProvider

An implementation of a context menu provider for GMF diagrams It adds contributions to the popup menu both programatically and through the contribution item service

See Also:
ContributionItemService

Constructor Summary
DiagramContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer)
          Constructor for DiagramContextMenuProvider.
 
Method Summary
protected  void addDefaultExclusions()
          Transfer the String array defaultExclusionList into the exclusionSet
protected  boolean allowItem(IContributionItem itemToAdd)
           
 void buildContextMenu(IMenuManager menu)
           
 ActionRegistry getActionRegistry()
          Returns the actionRegistry.
 java.util.Set getExclusionSet()
          The exclusion Set allows clients to specify which contributed menu items they do not want to include in their context menus.
 void setExclusionSet(java.util.Set exclusionSet)
          set the exclusion Set.
 
Methods inherited from class org.eclipse.gef.ContextMenuProvider
getViewer, menuAboutToShow, setViewer
 
Methods inherited from class org.eclipse.jface.action.MenuManager
addMenuListener, createContextMenu, createMenuBar, createMenuBar, dispose, fill, fill, fill, fill, findMenuUsingPath, findUsingPath, getId, getMenu, getMenuText, getOverrides, getParent, getRemoveAllWhenShown, isDynamic, isEnabled, isGroupMarker, isSeparator, isSubstituteFor, isVisible, markDirty, removeMenuListener, saveWidgetState, setOverrides, setParent, setRemoveAllWhenShown, setVisible, update, update, update, update, updateAll
 
Methods inherited from class org.eclipse.jface.action.ContributionManager
add, add, appendToGroup, appendToGroup, dumpStatistics, find, getItems, hasDynamicItems, indexOf, indexOf, insert, insertAfter, insertAfter, insertBefore, insertBefore, internalSetItems, isDirty, isEmpty, itemAdded, itemRemoved, prependToGroup, prependToGroup, remove, remove, removeAll, replaceItem, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IContributionManager
add, add, appendToGroup, appendToGroup, find, getItems, insertAfter, insertAfter, insertBefore, insertBefore, isDirty, isEmpty, prependToGroup, prependToGroup, remove, remove, removeAll
 
Methods inherited from interface org.eclipse.jface.action.IContributionItem
isDirty
 

Constructor Detail

DiagramContextMenuProvider

public DiagramContextMenuProvider(IWorkbenchPart part,
                                  EditPartViewer viewer)
Constructor for DiagramContextMenuProvider.

Parameters:
part -
viewer -
Method Detail

getActionRegistry

public ActionRegistry getActionRegistry()
Returns the actionRegistry.

Returns:
ActionRegistry

buildContextMenu

public void buildContextMenu(IMenuManager menu)
See Also:
ContextMenuProvider.buildContextMenu(IMenuManager)

getExclusionSet

public java.util.Set getExclusionSet()
The exclusion Set allows clients to specify which contributed menu items they do not want to include in their context menus.

Returns:
Set of IDs

setExclusionSet

public void setExclusionSet(java.util.Set exclusionSet)
set the exclusion Set.

Parameters:
exclusionSet - the Set of IDs of menu items that need to be excluded from the context menu
See Also:
DiagramContextMenuProvider.getExclusionSet()

allowItem

protected boolean allowItem(IContributionItem itemToAdd)

addDefaultExclusions

protected void addDefaultExclusions()
Transfer the String array defaultExclusionList into the exclusionSet


Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.