Package org.eclipse.ui.internal
Class ObjectContributorManager
java.lang.Object
org.eclipse.ui.internal.ObjectContributorManager
- All Implemented Interfaces:
- IExtensionChangeHandler
- Direct Known Subclasses:
- ObjectActionContributorManager
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 interfaces in the order
 returned by getInterfaces()(in the example, A and its superinterfaces then B and its superinterfaces)
 
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected MapCache of adaptable class contributor search paths;nullif none.protected Setprotected MapTable of contributors.protected MapCache of object class contributor search paths;nullif none.protected MapCache of resource adapter class contributor search paths;nullif none.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ListaddContributorsFor(Class objectClass) Return the list of contributors for the supplied class.protected final ListcomputeClassOrder(Class extensibleClass) Returns the class search order starting withextensibleClass.protected ListcomputeCombinedOrder(Class inputClass) Returns the class search order starting withextensibleClass.protected final ListcomputeInterfaceOrder(List classList) Returns the interface search order for the class hierarchy described byclassList.voiddispose()Remove listeners and dispose of this manager.voidFlushes the cache of contributor search paths.protected ListgetAdaptableContributors(String adapterType) Returns the contributions for the given type name.Get the contributions registered to this manager.protected ListgetContributors(Object object) protected ListgetContributors(List elements) Returns the list of contributors that are interested in the given list of model elements.protected StringReturn the extension point id (local to org.eclipse.ui) that this manager is associated with.protected ListgetObjectContributors(Class objectClass) Returns the contributions for the given class.protected ListgetResourceContributors(Class resourceClass) Returns the contributions for the givenIResourceclass.booleanhasContributorsFor(Object object) Returns true if contributors exist in the manager for this object and any of it's super classes, interfaces, or adapters.booleanisApplicableTo(List list, IObjectContributor contributor) Return whether the given contributor is applicable to all elements in the list.booleanisApplicableTo(IStructuredSelection selection, IObjectContributor contributor) Return whether the given contributor is applicable to all elements in the selection.voidregisterContributor(IObjectContributor contributor, String targetType) Register a contributor.protected voidremoveCommonAdapters(List adapters, List results) Prunes from the list of adapters type names that are in the class search order of every class inresults.voidremoveExtension(IExtension source, Object[] objects) This method is called after the removal of an extension.voidUnregister all contributors.voidunregisterContributor(IObjectContributor contributor, String targetType) Unregister a contributor from the target type.voidunregisterContributors(String targetType) Unregister all contributors for the target type.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandleraddExtension
- 
Field Details- 
contributorsTable of contributors.
- 
objectLookupCache of object class contributor search paths;nullif none.
- 
resourceAdapterLookupCache of resource adapter class contributor search paths;nullif none.
- 
adaptableLookupCache of adaptable class contributor search paths;nullif none.
- 
contributorRecordSet
 
- 
- 
Constructor Details- 
ObjectContributorManagerpublic ObjectContributorManager()Constructs a new contributor manager.
 
- 
- 
Method Details- 
getExtensionPointFilterReturn the extension point id (local to org.eclipse.ui) that this manager is associated with. Default implementation returns null, which implies no relationship with a particular extension.- Returns:
- the extension point id
- Since:
- 3.4
 
- 
computeClassOrderReturns the class search order starting withextensibleClass. The search order is defined in this class' comment.
- 
computeInterfaceOrderReturns the interface search order for the class hierarchy described byclassList. The search order is defined in this class' comment.
- 
flushLookuppublic void flushLookup()Flushes the cache of contributor search paths. This is generally required whenever a contributor is added or removed.It is likely easier to just toss the whole cache rather than trying to be smart and remove only those entries affected. 
- 
getContributorsGet the contributions registered to this manager.- Returns:
- an unmodifiable Collectioncontaining all registered contributions. The objects in thisCollectionwill beLists containing the actual contributions.
- Since:
- 3.0
 
- 
addContributorsForReturn the list of contributors for the supplied class.
- 
hasContributorsForReturns 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
- Returns:
- whether the object has contributors
 
- 
isApplicableToReturn whether the given contributor is applicable to all elements in the selection.- Parameters:
- selection- the selection
- contributor- the contributor
- Returns:
- whether it is applicable
 
- 
isApplicableToReturn whether the given contributor is applicable to all elements in the list.- Parameters:
- list- the selection
- contributor- the contributor
- Returns:
- whether it is applicable
 
- 
registerContributorRegister a contributor.- Parameters:
- contributor- the contributor
- targetType- the target type
 
- 
unregisterAllContributorspublic void unregisterAllContributors()Unregister all contributors.
- 
unregisterContributorUnregister a contributor from the target type.- Parameters:
- contributor- the contributor
- targetType- the target type
 
- 
unregisterContributorsUnregister all contributors for the target type.- Parameters:
- targetType- the target type
 
- 
getContributors
- 
getObjectContributorsReturns the contributions for the given class. This considers contributors on any super classes and interfaces.- Parameters:
- objectClass- the class to search for contributions.
- Returns:
- the contributions for the given class. This considers contributors on any super classes and interfaces.
- Since:
- 3.1
 
- 
getResourceContributorsReturns the contributions for the givenIResourceclass. 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.
- Returns:
- the contributions for the given class. This considers adaptable contributors on any super classes and interfaces.
- Since:
- 3.1
 
- 
getAdaptableContributorsReturns the contributions for the given type name.- Parameters:
- adapterType- the class to search for contributions.
- Returns:
- the contributions for the given class. This considers contributors to this specific type.
- Since:
- 3.1
 
- 
removeCommonAdaptersPrunes from the list of adapters type names that are in the class search order of every class inresults.- Since:
- 3.1
 
- 
computeCombinedOrderReturns the class search order starting withextensibleClass. The search order is defined in this class' comment.
- 
removeExtensionDescription copied from interface:IExtensionChangeHandlerThis method is called after the removal of an extension.- Specified by:
- removeExtensionin interface- IExtensionChangeHandler
- Parameters:
- source- the extension being removed
- objects- the objects that were associated with the removed extension
 
- 
disposepublic void dispose()Remove listeners and dispose of this manager.- Since:
- 3.1
 
- 
getContributorsReturns the list of contributors that are interested in the given list of model elements.- Parameters:
- elements- a list of model elements (- Object)
- Returns:
- the list of interested contributors (IObjectContributor)
 
 
-