Class ObjectActionContributor

All Implemented Interfaces:
IAdaptable, IObjectActionContributor, IObjectContributor

public class ObjectActionContributor extends PluginActionBuilder implements IObjectActionContributor, IAdaptable
This class describes the object contribution element within the popup menu action registry.
  • Constructor Details

    • ObjectActionContributor

      public ObjectActionContributor(IConfigurationElement config)
      The constructor.
      config - the element
  • Method Details

    • canAdapt

      public boolean canAdapt()
      Description copied from interface: IObjectContributor
      Return whether or not the receiver can adapt to IResource.
      Specified by:
      canAdapt in interface IObjectContributor
    • getObjectClass

      public String getObjectClass()
      Return the object class for this contributor.
      the object class
    • contributeObjectActionIdOverrides

      public void contributeObjectActionIdOverrides(List actionIdOverrides)
      Description copied from interface: IObjectActionContributor
      Contribute to the list the action identifiers from other contributions that this contribution wants to override. Actions of these identifiers will not be contributed.
      Specified by:
      contributeObjectActionIdOverrides in interface IObjectActionContributor
    • contributeObjectActions

      public boolean contributeObjectActions(IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides)
      Contributes actions applicable for the current selection.
      Specified by:
      contributeObjectActions in interface IObjectActionContributor
      true if any contributions were made, and false otherwise.
    • contributeObjectMenus

      public boolean contributeObjectMenus(IMenuManager menu, ISelectionProvider selProv)
      Contributes menus applicable for the current selection.
      Specified by:
      contributeObjectMenus in interface IObjectActionContributor
      true if any contributions were made, and false otherwise.
    • createActionDescriptor

      protected ActionDescriptor createActionDescriptor(IConfigurationElement element)
      Description copied from class: PluginActionBuilder
      This factory method returns a new ActionDescriptor for the configuration element. It should be implemented by subclasses.
      Specified by:
      createActionDescriptor in class PluginActionBuilder
    • createContribution

      protected PluginActionBuilder.BasicContribution createContribution()
      Description copied from class: PluginActionBuilder
      Factory method to create the helper contribution class that will hold onto the menus and actions contributed.
      createContribution in class PluginActionBuilder
    • isApplicableTo

      public boolean isApplicableTo(Object object)
      Returns true if name filter is not specified for the contribution or the current selection matches the filter.
      Specified by:
      isApplicableTo in interface IObjectContributor
      object - the object to text
    • readElement

      protected boolean readElement(IConfigurationElement element)
      Description copied from class: PluginActionBuilder
      Implements abstract method to handle the provided XML element in the registry.
      readElement in class PluginActionBuilder
      true if element was recognized, false if not.
    • toString

      public String toString()
      Debugging helper that will print out the contribution names for this contributor.
      toString in class Object
    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Description copied from interface: IAdaptable
      Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

      Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean) rather than invoking it directly.

      Specified by:
      getAdapter in interface IAdaptable
      Type Parameters:
      T - the class type
      adapter - the adapter class to look up
      a object of the given class, or null if this object does not have an adapter for the given class