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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAdapt()
Return whether or not the receiver can adapt to IResource.void
contributeObjectActionIdOverrides
(List actionIdOverrides) Contribute to the list the action identifiers from other contributions that this contribution wants to override.boolean
contributeObjectActions
(IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides) Contributes actions applicable for the current selection.boolean
contributeObjectMenus
(IMenuManager menu, ISelectionProvider selProv) Contributes menus applicable for the current selection.protected ActionDescriptor
This factory method returns a new ActionDescriptor for the configuration element.protected PluginActionBuilder.BasicContribution
Factory method to create the helper contribution class that will hold onto the menus and actions contributed.<T> T
getAdapter
(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.boolean
isApplicableTo
(Object object) Returns true if name filter is not specified for the contribution or the current selection matches the filter.protected boolean
readElement
(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, setAllowIdeLogging
Methods 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:IObjectContributor
Return whether or not the receiver can adapt to IResource.- Specified by:
canAdapt
in interfaceIObjectContributor
- Returns:
- boolean
-
getObjectClass
Return the object class for this contributor.- Returns:
- the object class
-
contributeObjectActionIdOverrides
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 interfaceIObjectActionContributor
-
contributeObjectActions
public boolean contributeObjectActions(IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides) Contributes actions applicable for the current selection.- Specified by:
contributeObjectActions
in interfaceIObjectActionContributor
- Returns:
true
if any contributions were made, andfalse
otherwise.
-
contributeObjectMenus
Contributes menus applicable for the current selection.- Specified by:
contributeObjectMenus
in interfaceIObjectActionContributor
- Returns:
true
if any contributions were made, andfalse
otherwise.
-
createActionDescriptor
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 classPluginActionBuilder
-
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 classPluginActionBuilder
-
isApplicableTo
Returns true if name filter is not specified for the contribution or the current selection matches the filter.- Specified by:
isApplicableTo
in interfaceIObjectContributor
- Parameters:
object
- the object to text- Returns:
- boolean
-
readElement
Description copied from class:PluginActionBuilder
Implements abstract method to handle the provided XML element in the registry.- Overrides:
readElement
in 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:IAdaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
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 interfaceIAdaptable
- 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
-