Remote Systems
v6.4.1

com.ibm.etools.systems.core
Class SystemPopupMenuActionContributor

java.lang.Object
  extended byPluginActionBuilder
      extended bycom.ibm.etools.systems.core.SystemPopupMenuActionContributor

public class SystemPopupMenuActionContributor
extends PluginActionBuilder

This class is ripped off from ObjectActionContributor from Eclipse. It looks after parsing the tag from our com.ibm.etools.systems.core.PopupMenus extension point.

We modelled our com.ibm.etools.systems.core.popupMenus extension point after the org.eclipse.ui.popupMenus extension point, so it makes sense to model the code to support it after the Eclipse code to support theirs. To that end, we have to replace the class that parses the tag, because that class does not support subclassing, and change it to:

TODO use overrides list

See Also:
SystemPopupMenuActionContributorManager, SystemPopupMenuActionContributorReader, Serialized Form

Field Summary
static String copyright
           
 
Constructor Summary
SystemPopupMenuActionContributor(IConfigurationElement element)
          Constructor for SystemPopupMenuActionContributor
 
Method Summary
protected  void addGroup(IContributionManager mgr, String name)
          Adds a group to a contribution manager.
 boolean canAdapt()
           
protected  void contributeGroupMarker(IMenuManager menu, IConfigurationElement element)
          Creates a named menu group marker from the information in the configuration element.
protected  void contributeMenu(IConfigurationElement menuElement, IMenuManager mng, boolean appendIfMissing)
          Creates a menu from the information in the menu configuration element and adds it into the provided menu manager.
protected  void contributeMenuAction(ActionDescriptor ad, IMenuManager menu, boolean appendIfMissing)
          Contributes action from action descriptor into the provided menu manager.
 void contributeObjectActionIdOverrides(List actionIdOverrides)
          Contribute to the list the action identifiers from other contributions that this contribution wants to override.
 boolean contributeObjectActions(IWorkbenchPart part, SystemMenuManager menu, ISelectionProvider selProv, List actionIdOverrides)
          Contributes actions applicable for the current selection.
 boolean contributeObjectMenus(SystemMenuManager menu, ISelectionProvider selProv)
          Contributes menus applicable for the current selection.
protected  void contributeSeparator(IMenuManager menu, IConfigurationElement element)
          Creates a named menu separator from the information in the configuration element.
protected  void contributeToolbarAction(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing)
          Contributes action from the action descriptor into the provided tool bar manager.
protected  ActionDescriptor createActionDescriptor(IConfigurationElement element)
          This factory method returns a new ActionDescriptor for the configuration element.
 String getCategoryFilter()
          Getter method.
 String getNameFilter()
          Getter method.
protected  String getPathRoot(String path)
          get the root part of the path
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
 String getSubSubTypeFilter()
          Getter method.
 String getSubSystemFactoryCategoryFilter()
          Getter method.
 String getSubSystemFactoryId()
          Getter method.
 String getSubTypeFilter()
          Getter method.
 String getSystemTypesFilter()
          Getter method.
 String getTypeFilter()
          Getter method.
protected  void insertAfter(IContributionManager mgr, String refId, PluginAction action)
          Inserts an action after another named contribution item.
protected  void insertMenuGroup(IMenuManager menu, AbstractGroupMarker marker)
          Inserts the separator or group marker into the menu.
 boolean isApplicableTo(Object object)
          Returns true if the current selection matches all the given filtering criteria.
protected  void readContributions(String id, String tag, String extensionPoint)
           
protected  boolean readElement(IConfigurationElement element)
          Implements abstract method to handle the provided XML element in the registry.
 
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
Constructor Detail

SystemPopupMenuActionContributor

public SystemPopupMenuActionContributor(IConfigurationElement element)
Constructor for SystemPopupMenuActionContributor

Method Detail

getCategoryFilter

public String getCategoryFilter()
Getter method. Return what was specified for the typecategoryfilter xml attribute.


getNameFilter

public String getNameFilter()
Getter method. Return what was specified for the namefilter xml attribute.


getTypeFilter

public String getTypeFilter()
Getter method. Return what was specified for the typefilter xml attribute.


getSubTypeFilter

public String getSubTypeFilter()
Getter method. Return what was specified for the subtypefilter xml attribute.


getSubSubTypeFilter

public String getSubSubTypeFilter()
Getter method. Return what was specified for the subsubtypefilter xml attribute.


getSubSystemFactoryId

public String getSubSystemFactoryId()
Getter method. Return what was specified for the subsystemfactoryid xml attribute.


getSubSystemFactoryCategoryFilter

public String getSubSystemFactoryCategoryFilter()
Getter method. Return what was specified for the subsystemfactoryCategory xml attribute.


getSystemTypesFilter

public String getSystemTypesFilter()
Getter method. Return what was specified for the systemtypes xml attribute.


getRemoteAdapter

protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. Returns null if this object does not adaptable to this.


contributeObjectActions

public boolean contributeObjectActions(IWorkbenchPart part,
                                       SystemMenuManager menu,
                                       ISelectionProvider selProv,
                                       List actionIdOverrides)
Contributes actions applicable for the current selection.


contributeObjectActionIdOverrides

public void contributeObjectActionIdOverrides(List actionIdOverrides)
Contribute to the list the action identifiers from other contributions that this contribution wants to override. Actions of these identifiers will not be contributed.


contributeObjectMenus

public boolean contributeObjectMenus(SystemMenuManager menu,
                                     ISelectionProvider selProv)
Contributes menus applicable for the current selection.


createActionDescriptor

protected ActionDescriptor createActionDescriptor(IConfigurationElement element)
This factory method returns a new ActionDescriptor for the configuration element.


isApplicableTo

public boolean isApplicableTo(Object object)
Returns true if the current selection matches all the given filtering criteria.


readContributions

protected void readContributions(String id,
                                 String tag,
                                 String extensionPoint)

readElement

protected boolean readElement(IConfigurationElement element)
Implements abstract method to handle the provided XML element in the registry.


getPathRoot

protected String getPathRoot(String path)
get the root part of the path


canAdapt

public boolean canAdapt()

contributeMenu

protected void contributeMenu(IConfigurationElement menuElement,
                              IMenuManager mng,
                              boolean appendIfMissing)
Creates a menu from the information in the menu configuration element and adds it into the provided menu manager. If 'appendIfMissing' is true, and menu path slot is not found, it will be created and menu will be added into it. Otherwise, add operation will fail.


contributeMenuAction

protected void contributeMenuAction(ActionDescriptor ad,
                                    IMenuManager menu,
                                    boolean appendIfMissing)
Contributes action from action descriptor into the provided menu manager.


contributeSeparator

protected void contributeSeparator(IMenuManager menu,
                                   IConfigurationElement element)
Creates a named menu separator from the information in the configuration element. If the separator already exists do not create a second.


contributeGroupMarker

protected void contributeGroupMarker(IMenuManager menu,
                                     IConfigurationElement element)
Creates a named menu group marker from the information in the configuration element. If the marker already exists do not create a second.


contributeToolbarAction

protected void contributeToolbarAction(ActionDescriptor ad,
                                       IToolBarManager toolbar,
                                       boolean appendIfMissing)
Contributes action from the action descriptor into the provided tool bar manager.


insertMenuGroup

protected void insertMenuGroup(IMenuManager menu,
                               AbstractGroupMarker marker)
Inserts the separator or group marker into the menu. Subclasses may override.


insertAfter

protected void insertAfter(IContributionManager mgr,
                           String refId,
                           PluginAction action)
Inserts an action after another named contribution item. Subclasses may override.


addGroup

protected void addGroup(IContributionManager mgr,
                        String name)
Adds a group to a contribution manager. Subclasses may override.


Remote Systems
v6.4.1

Copyright © 2005 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.