Eclipse GEF
3.0

org.eclipse.gef
Class ContextMenuProvider

java.lang.Object
  extended byMenuManager
      extended byorg.eclipse.gef.ContextMenuProvider
Direct Known Subclasses:
PaletteContextMenuProvider

public abstract class ContextMenuProvider
extends MenuManager

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.

See Also:
Serialized Form

Constructor Summary
ContextMenuProvider(EditPartViewer viewer)
          Constructs a context menu for the specified EditPartViewer.
 
Method Summary
abstract  void buildContextMenu(IMenuManager menu)
          Called when the menu is about to show.
protected  EditPartViewer getViewer()
          Returns the EditPartViewer
 void menuAboutToShow(IMenuManager menu)
           
protected  void setViewer(EditPartViewer viewer)
          Sets the editpart viewer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenuProvider

public ContextMenuProvider(EditPartViewer viewer)
Constructs a context menu for the specified EditPartViewer.

Parameters:
viewer - the editpart viewer
Method Detail

buildContextMenu

public abstract void buildContextMenu(IMenuManager menu)
Called 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 this object

getViewer

protected EditPartViewer getViewer()
Returns the EditPartViewer

Returns:
the viewer

menuAboutToShow

public void menuAboutToShow(IMenuManager menu)
See Also:
IMenuListener#menuAboutToShow(IMenuManager)

setViewer

protected void setViewer(EditPartViewer viewer)
Sets the editpart viewer. Called during construction.

Parameters:
viewer - the viewer

Eclipse GEF
3.0

Copyright (c) IBM Corp. and others 2000, 2004. All Rights Reserved.