roneditor.editor
Class ContextMenuProviderWithActionRegistry

java.lang.Object
  extended by org.eclipse.jface.action.ContributionManager
      extended by org.eclipse.jface.action.MenuManager
          extended by org.eclipse.gef.ContextMenuProvider
              extended by roneditor.editor.ContextMenuProviderWithActionRegistry
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem, org.eclipse.jface.action.IContributionManager, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.action.IMenuManager
Direct Known Subclasses:
ObjectNetPageContextMenuProvider, RONEditorContextMenuProvider, RONPageContextMenuProvider, RulePageContextMenuProvider

public abstract class ContextMenuProviderWithActionRegistry
extends org.eclipse.gef.ContextMenuProvider

This ContextMenuProvider gets an ActionRegistry in its constructor which is used to resolve actions via some key, usually their IDs. Some methods are provided to append (dynamically) an action several standard GEF action groups.

Author:
Tony Modica

Field Summary
private  org.eclipse.gef.ui.actions.ActionRegistry actionRegistry
          The ActionRegistry used to resolve the actions.
 
Constructor Summary
ContextMenuProviderWithActionRegistry(org.eclipse.gef.EditPartViewer viewer, org.eclipse.gef.ui.actions.ActionRegistry actionRegistry)
          The constructor for this class.
 
Method Summary
protected  void appendActionToGroup(org.eclipse.jface.action.IMenuManager menu, java.lang.String actionId, java.lang.String group)
          Appends the specified action to the specified group.
protected  void dynamicAppendActionToGroup(org.eclipse.jface.action.IMenuManager menu, java.lang.String actionId, java.lang.String group)
          Appends the specified action to the menu edit group if the action is enabled.
 
Methods inherited from class org.eclipse.gef.ContextMenuProvider
buildContextMenu, 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, allowItem, 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
 

Field Detail

actionRegistry

private org.eclipse.gef.ui.actions.ActionRegistry actionRegistry
The ActionRegistry used to resolve the actions.

Constructor Detail

ContextMenuProviderWithActionRegistry

public ContextMenuProviderWithActionRegistry(org.eclipse.gef.EditPartViewer viewer,
                                             org.eclipse.gef.ui.actions.ActionRegistry actionRegistry)
The constructor for this class.

Parameters:
viewer - The viewer in which the context menu is used.
actionRegistry - An action registry hosting the actions to show in the context menu.
Method Detail

appendActionToGroup

protected void appendActionToGroup(org.eclipse.jface.action.IMenuManager menu,
                                   java.lang.String actionId,
                                   java.lang.String group)
Appends the specified action to the specified group.

Parameters:
menu - The MenuManager to be used.
actionId - The id of the action to be put in the context menu.
group - The group to put in the action.

dynamicAppendActionToGroup

protected void dynamicAppendActionToGroup(org.eclipse.jface.action.IMenuManager menu,
                                          java.lang.String actionId,
                                          java.lang.String group)
Appends the specified action to the menu edit group if the action is enabled.

Parameters:
menu - The MenuManager to be used.
actionId - The id of the action to be put in the context menu.
group - The group to put in the action.