Class ObjectActionContributor

java.lang.Object
org.eclipse.ui.internal.registry.RegistryReader
org.eclipse.ui.internal.PluginActionBuilder
org.eclipse.ui.internal.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.
      Parameters:
      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
      Returns:
      boolean
    • getObjectClass

      public String getObjectClass()
      Return the object class for this contributor.
      Returns:
      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
      Returns:
      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
      Returns:
      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.
      Overrides:
      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
      Parameters:
      object - the object to text
      Returns:
      boolean
    • readElement

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

      public String toString()
      Debugging helper that will print out the contribution names for this contributor.
      Overrides:
      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
      Parameters:
      adapter - the adapter class to look up
      Returns:
      a object of the given class, or null if this object does not have an adapter for the given class