uk.ac.kcl.cch.jb.pliny.actions
Class PlinyMenuProvider

java.lang.Object
  extended byorg.eclipse.jface.action.ContributionManager
      extended byorg.eclipse.jface.action.MenuManager
          extended byorg.eclipse.gef.ContextMenuProvider
              extended byuk.ac.kcl.cch.jb.pliny.actions.PlinyMenuProvider
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem, org.eclipse.jface.action.IContributionManager, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.action.IMenuManager

public class PlinyMenuProvider
extends org.eclipse.gef.ContextMenuProvider

An extension to GEF's ContextMenuProvider for Pliny applications which supports the presentation of a contextual menu in GEF environments.

It examines the selected GEF AbstractEditParts, and for each one which is a BaseObject it looks to see if it is typeable (has a LOType), and if one or more LinkableObject has been selected. Based on these observations it decides whether or not to show the menu options that allow the user to set a type, and whether or not to show the options related to selected items (minimize, maximize and open).

Author:
John Bradley

Constructor Summary
PlinyMenuProvider(org.eclipse.gef.EditPartViewer viewer, org.eclipse.gef.commands.CommandStack commandStack)
           
 
Method Summary
 void buildContextMenu(org.eclipse.jface.action.IMenuManager menu)
           
 
Methods inherited from class org.eclipse.gef.ContextMenuProvider
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
 

Constructor Detail

PlinyMenuProvider

public PlinyMenuProvider(org.eclipse.gef.EditPartViewer viewer,
                         org.eclipse.gef.commands.CommandStack commandStack)
Method Detail

buildContextMenu

public void buildContextMenu(org.eclipse.jface.action.IMenuManager menu)