Package org.eclipse.gef
Class ContextMenuProvider
java.lang.Object
org.eclipse.jface.action.ContributionManager
org.eclipse.jface.action.MenuManager
org.eclipse.gef.ContextMenuProvider
- All Implemented Interfaces:
- IContributionItem,- IContributionManager,- IMenuListener,- IMenuManager
- Direct Known Subclasses:
- PaletteContextMenuProvider
Extends MenuManager to allow populating the menu directly from the manager
 itself. Using this class is no different than using a standalone
 
MenuManager, and adding a menuAboutToShow listener.- 
Field SummaryFields inherited from class org.eclipse.jface.action.MenuManagerMANAGER_KEY, visible
- 
Constructor SummaryConstructorsConstructorDescriptionContextMenuProvider(EditPartViewer viewer) Constructs a context menu for the specified EditPartViewer.
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidbuildContextMenu(IMenuManager menu) Called when the menu is about to show.protected EditPartViewerReturns the EditPartViewervoidmenuAboutToShow(IMenuManager menu) protected voidsetViewer(EditPartViewer viewer) Sets the editpart viewer.Methods inherited from class org.eclipse.jface.action.MenuManageraddMenuListener, createContextMenu, createMenuBar, createMenuBar, dispose, doItemFill, fill, fill, fill, fill, findMenuUsingPath, findUsingPath, getId, getImageDescriptor, getMenu, getMenuItem, getMenuItemCount, getMenuItems, getMenuText, getOverrides, getParent, getRemoveAllWhenShown, isDynamic, isEnabled, isGroupMarker, isSeparator, isSubstituteFor, isVisible, markDirty, menuExist, removeMenuListener, saveWidgetState, setActionDefinitionId, setImageDescriptor, setMenuText, setOverrides, setParent, setRemoveAllWhenShown, setVisible, toString, update, update, update, update, updateAllMethods inherited from class org.eclipse.jface.action.ContributionManageradd, add, allowItem, appendToGroup, appendToGroup, dumpStatistics, find, getItems, getSize, hasDynamicItems, indexOf, indexOf, insert, insertAfter, insertAfter, insertBefore, insertBefore, internalSetItems, isDirty, isEmpty, itemAdded, itemRemoved, prependToGroup, prependToGroup, remove, remove, removeAll, replaceItem, setDirtyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.action.IContributionItemisDirtyMethods inherited from interface org.eclipse.jface.action.IContributionManageradd, add, appendToGroup, appendToGroup, find, getItems, insertAfter, insertAfter, insertBefore, insertBefore, isDirty, isEmpty, prependToGroup, prependToGroup, remove, remove, removeAll
- 
Constructor Details- 
ContextMenuProviderConstructs a context menu for the specified EditPartViewer.- Parameters:
- viewer- the editpart viewer
 
 
- 
- 
Method Details- 
buildContextMenuCalled when the menu is about to show. Subclasses must implement this method to populate the menu each time it is shown.- Parameters:
- menu- this parameter is actually- thisobject
 
- 
getViewerReturns the EditPartViewer- Returns:
- the viewer
 
- 
setViewerSets the editpart viewer. Called during construction.- Parameters:
- viewer- the viewer
 
 
-