abstractpublic class ObjectContributorManager implements IExtensionChangeHandler(Code)
This class is a default implementation of IObjectContributorManager.
It provides fast merging of contributions with the following semantics:
All of the matching contributors will be invoked per property lookup
The search order from a class with the definition class X extends Y implements A, B
is as follows:
the target's class: X
X's superclasses in order to Object
a depth-first traversal of the target class's interaces in the order
returned by getInterfaces() (in the example, A and
its superinterfaces then B and its superinterfaces)
hasContributorsFor(Object object) Returns true if contributors exist in the manager for
this object and any of it's super classes, interfaces, or
adapters.
public boolean
isApplicableTo(IStructuredSelection selection, IObjectContributor contributor) Return whether the given contributor is applicable to all elements in the
selection.
removeCommonAdapters(List adapters, List results) Prunes from the list of adapters type names that are in the class
search order of every class in results.
Return whether or not the receiver handles extension
tracking. Default is true. Subclasses may override.
boolean true if it should be registeredas an extension handler.
computeClassOrder
final protectedList computeClassOrder(Class extensibleClass)(Code)
Returns the class search order starting with extensibleClass.
The search order is defined in this class' comment.
Returns the contributions for the given type name.
Parameters: adapterType - the class to search for contributions. the contributions for the given class. This considerscontributors to this specific type. since: 3.1
Get the contributions registered to this manager.
an unmodifiable Collection containing all registeredcontributions. The objects in this Collection will be Lists containing the actual contributions. since: 3.0
Returns the list of contributors that are interested in the
given list of model elements.
Parameters: elements - a list of model elements (Object) the list of interested contributors (IObjectContributor)
Returns the contributions for the given class. This considers
contributors on any super classes and interfaces.
Parameters: objectClass - the class to search for contributions. the contributions for the given class. This considerscontributors on any super classes and interfaces. since: 3.1
Returns the contributions for the given IResourceclass.
This considers contributors on any super classes and interfaces. This
will only return contributions that are adaptable.
Parameters: resourceClass - the class to search for contributions. the contributions for the given class. This considersadaptable contributors on any super classes and interfaces. since: 3.1
hasContributorsFor
public boolean hasContributorsFor(Object object)(Code)
Returns true if contributors exist in the manager for
this object and any of it's super classes, interfaces, or
adapters.
Parameters: object - the object to test whether the object has contributors
isApplicableTo
public boolean isApplicableTo(IStructuredSelection selection, IObjectContributor contributor)(Code)
Return whether the given contributor is applicable to all elements in the
selection.
Parameters: selection - the selection Parameters: contributor - the contributor whether it is applicable
Return whether the given contributor is applicable to all elements in the
list.
Parameters: list - the selection Parameters: contributor - the contributor whether it is applicable
Register a contributor.
Parameters: contributor - the contributor Parameters: targetType - the target type
removeCommonAdapters
protected void removeCommonAdapters(List adapters, List results)(Code)
Prunes from the list of adapters type names that are in the class
search order of every class in results.
Parameters: adapters - Parameters: results - since: 3.1
removeExtension
public void removeExtension(IExtension source, Object[] objects)(Code)