Package org.eclipse.ui.internal
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.ui.internal.PluginActionBuilder
PluginActionBuilder.BasicContribution -
Field Summary
Fields inherited from class org.eclipse.ui.internal.PluginActionBuilder
cache, currentContribution, targetContributionTag, targetID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAdapt()Return whether or not the receiver can adapt to IResource.voidcontributeObjectActionIdOverrides(List actionIdOverrides) Contribute to the list the action identifiers from other contributions that this contribution wants to override.booleancontributeObjectActions(IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides) Contributes actions applicable for the current selection.booleancontributeObjectMenus(IMenuManager menu, ISelectionProvider selProv) Contributes menus applicable for the current selection.protected ActionDescriptorThis factory method returns a new ActionDescriptor for the configuration element.protected PluginActionBuilder.BasicContributionFactory method to create the helper contribution class that will hold onto the menus and actions contributed.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Return the object class for this contributor.booleanisApplicableTo(Object object) Returns true if name filter is not specified for the contribution or the current selection matches the filter.protected booleanreadElement(IConfigurationElement element) Implements abstract method to handle the provided XML element in the registry.toString()Debugging helper that will print out the contribution names for this contributor.Methods inherited from class org.eclipse.ui.internal.PluginActionBuilder
contribute, getID, getTargetID, readContributions, setAllowIdeLoggingMethods inherited from class org.eclipse.ui.internal.registry.RegistryReader
getClassValue, getDescription, logError, logMissingAttribute, logMissingElement, logUnknownElement, orderExtensions, readElementChildren, readElements, readExtension, readRegistry
-
Constructor Details
-
ObjectActionContributor
The constructor.- Parameters:
config- the element
-
-
Method Details
-
canAdapt
public boolean canAdapt()Description copied from interface:IObjectContributorReturn whether or not the receiver can adapt to IResource.- Specified by:
canAdaptin interfaceIObjectContributor- Returns:
- boolean
-
getObjectClass
Return the object class for this contributor.- Returns:
- the object class
-
contributeObjectActionIdOverrides
Description copied from interface:IObjectActionContributorContribute 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:
contributeObjectActionIdOverridesin interfaceIObjectActionContributor
-
contributeObjectActions
public boolean contributeObjectActions(IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides) Contributes actions applicable for the current selection.- Specified by:
contributeObjectActionsin interfaceIObjectActionContributor- Returns:
trueif any contributions were made, andfalseotherwise.
-
contributeObjectMenus
Contributes menus applicable for the current selection.- Specified by:
contributeObjectMenusin interfaceIObjectActionContributor- Returns:
trueif any contributions were made, andfalseotherwise.
-
createActionDescriptor
Description copied from class:PluginActionBuilderThis factory method returns a new ActionDescriptor for the configuration element. It should be implemented by subclasses.- Specified by:
createActionDescriptorin classPluginActionBuilder
-
createContribution
Description copied from class:PluginActionBuilderFactory method to create the helper contribution class that will hold onto the menus and actions contributed.- Overrides:
createContributionin classPluginActionBuilder
-
isApplicableTo
Returns true if name filter is not specified for the contribution or the current selection matches the filter.- Specified by:
isApplicableToin interfaceIObjectContributor- Parameters:
object- the object to text- Returns:
- boolean
-
readElement
Description copied from class:PluginActionBuilderImplements abstract method to handle the provided XML element in the registry.- Overrides:
readElementin classPluginActionBuilder- Returns:
- true if element was recognized, false if not.
-
toString
Debugging helper that will print out the contribution names for this contributor. -
getAdapter
Description copied from interface:IAdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif 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:
getAdapterin interfaceIAdaptable- Type Parameters:
T- the class type- Parameters:
adapter- the adapter class to look up- Returns:
- a object of the given class, or
nullif this object does not have an adapter for the given class
-