Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.providers
Class ApplicationModelDiagramContextMenuProvider

java.lang.Object
  extended by DiagramContextMenuProvider
      extended by com.ibm.etools.systems.application.visual.editor.providers.ApplicationModelDiagramContextMenuProvider

public class ApplicationModelDiagramContextMenuProvider
extends DiagramContextMenuProvider

Context menu provider for Application Diagram. It filters out unnecessary GMF pre-defined context menus.


Field Summary
static String copyright
           
protected  IEditorPart editorPart
           
protected  List removedGroupIds
           
protected  List removedGroupItemIds
           
 
Constructor Summary
ApplicationModelDiagramContextMenuProvider(EditPartViewer viewer, ActionRegistry actionRegistry, IEditorPart editorPart)
          Constructor.
 
Method Summary
 void add(IContributionItem item)
          Add action.
protected  void addWithoutFilter(IContributionItem item)
          Avoids the filtering done above to retrieve the navigate group items from the contribution item service.
 void appendToGroup(String groupName, IAction action)
           
 void appendToGroup(String groupName, IContributionItem item)
           
 void buildContextMenu(IMenuManager menuManager)
           
protected  void buildSwitchViewMenu()
          Build switch view menu.
 void dispose()
          Disposes of this menu manager and frees all allocated SWT resources.
 IMenuManager findMenuUsingPath(String path)
          Override from MenuManager.
 String getId()
          Returns the menu id.
 void insert(int index, IContributionItem item)
          Override various insert / append methods of ContributionManager by ignoring any IllegalArgumentException exception.
 void insertAfter(String ID, IAction action)
           
 void insertAfter(String ID, IContributionItem item)
           
 void insertBefore(String ID, IAction action)
           
 void insertBefore(String ID, IContributionItem item)
           
 boolean isDiagramEditPartSelected()
          Return true if the current selected object is diagram editpart, false otherwise.
 void prependToGroup(String groupName, IAction action)
           
 void prependToGroup(String groupName, IContributionItem item)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

editorPart

protected IEditorPart editorPart

removedGroupIds

protected List removedGroupIds

removedGroupItemIds

protected List removedGroupItemIds
Constructor Detail

ApplicationModelDiagramContextMenuProvider

public ApplicationModelDiagramContextMenuProvider(EditPartViewer viewer,
                                                  ActionRegistry actionRegistry,
                                                  IEditorPart editorPart)
Constructor.

Parameters:
viewer: - the editpart viewer
actionRegistry: - the action registry of the editor
editorPart: - the editor part
Method Detail

getId

public String getId()
Returns the menu id. The menu id is used when creating a contribution item for adding this menu as a sub menu of another.


buildContextMenu

public void buildContextMenu(IMenuManager menuManager)
See Also:
org.eclipse.gef.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)

isDiagramEditPartSelected

public boolean isDiagramEditPartSelected()
Return true if the current selected object is diagram editpart, false otherwise.


buildSwitchViewMenu

protected void buildSwitchViewMenu()
Build switch view menu.


add

public void add(IContributionItem item)
Add action.


addWithoutFilter

protected void addWithoutFilter(IContributionItem item)
Avoids the filtering done above to retrieve the navigate group items from the contribution item service. This calls the superclass directly.

Parameters:
item -

findMenuUsingPath

public IMenuManager findMenuUsingPath(String path)
Override from MenuManager.


dispose

public void dispose()
Disposes of this menu manager and frees all allocated SWT resources. Notifies all contribution items of the dispose. Note that this method does not clean up references between this menu manager and its associated contribution items. Use removeAll for that purpose.


insert

public void insert(int index,
                   IContributionItem item)
Override various insert / append methods of ContributionManager by ignoring any IllegalArgumentException exception. These exceptions may happen when a menu or group is assumed to exist in the case of a regular diagram but is being filtered out in appliation diagram. Reason to do this: Insert / append will be delegated back to parent which does not except an illegal argument exception to be received by the caller.


insertAfter

public void insertAfter(String ID,
                        IAction action)

insertAfter

public void insertAfter(String ID,
                        IContributionItem item)

insertBefore

public void insertBefore(String ID,
                         IAction action)

insertBefore

public void insertBefore(String ID,
                         IContributionItem item)

prependToGroup

public void prependToGroup(String groupName,
                           IAction action)

prependToGroup

public void prependToGroup(String groupName,
                           IContributionItem item)

appendToGroup

public void appendToGroup(String groupName,
                          IAction action)

appendToGroup

public void appendToGroup(String groupName,
                          IContributionItem item)

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.