Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef
Class ContextMenuProvider

java.lang.Object
  extended by

org.eclipse.jface.action.ContributionManager
      extended by

org.eclipse.jface.action.MenuManager
          extended by
org.eclipse.gef.ContextMenuProvider
All Implemented Interfaces:
IContributionItem, IContributionManager, IMenuListener, IMenuManager
Direct Known Subclasses:
PaletteContextMenuProvider

public abstract class ContextMenuProvider
extends MenuManager
implements IMenuListener

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 Summary
 
Fields inherited from class org.eclipse.jface.action. MenuManager
visible
 
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 org.eclipse.jface.action. MenuManager
addMenuListener, 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, setOverrides, setParent, setRemoveAllWhenShown, setVisible, update, update, update, update, updateAll
 
Methods inherited from class org.eclipse.jface.action. ContributionManager
add, 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, 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

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)
Specified by:
menuAboutToShow in interface IMenuListener
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.3

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire