de.tu_berlin.cs.tfs.muvitorkit.ui
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 de.tu_berlin.cs.tfs.muvitorkit.ui.ContextMenuProviderWithActionRegistry
All Implemented Interfaces:
IContributionItem, IContributionManager, IMenuListener, IMenuManager

public abstract class ContextMenuProviderWithActionRegistry
extends 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 to several standard GEF action groups.

Rating red

Field Summary
 
Fields inherited from class org.eclipse.jface.action.MenuManager
visible
 
Constructor Summary
ContextMenuProviderWithActionRegistry(EditPartViewer viewer)
           
 
Method Summary
protected  void appendActionToGroup(IMenuManager menu, String actionId, String group)
          Appends the specified action to the specified group.
protected  void dynamicAppendActionToGroup(IMenuManager menu, String actionId, String group)
          Appends the specified action to the menu edit group if the action is enabled.
 void menuAboutToShow(IMenuManager menu)
          This is for registering some standard Actions that are used in the framework.
 
Methods inherited from class org.eclipse.gef.ContextMenuProvider
buildContextMenu, getViewer, setViewer
 
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

ContextMenuProviderWithActionRegistry

public ContextMenuProviderWithActionRegistry(EditPartViewer viewer)
Method Detail

menuAboutToShow

public void menuAboutToShow(IMenuManager menu)
This is for registering some standard Actions that are used in the framework. Subclasses should override ContextMenuProvider.buildContextMenu(IMenuManager) as usual.

Specified by:
menuAboutToShow in interface IMenuListener
Overrides:
menuAboutToShow in class ContextMenuProvider
See Also:
ContextMenuProvider.menuAboutToShow(IMenuManager)

appendActionToGroup

protected void appendActionToGroup(IMenuManager menu,
                                   String actionId,
                                   String group)
Appends the specified action to the specified group.

Parameters:
menu - The menu 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(IMenuManager menu,
                                          String actionId,
                                          String group)
Appends the specified action to the menu edit group if the action is enabled.

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