Remote Systems
v6.4.1

com.ibm.etools.systems.core
Class SystemObjectContributorManager

java.lang.Object
  extended bycom.ibm.etools.systems.core.SystemObjectContributorManager
Direct Known Subclasses:
SystemPopupMenuActionContributorManager

public abstract class SystemObjectContributorManager
extends Object

This class is a default implementation of IObjectContributorManager. It provides fast merging of contributions with the following semantics:

See Also:
IObjectContributor, IObjectContributorManager

Field Summary
protected  Map adapterLookup
          Cache of resource adapter class contributor search paths; null if none.
protected  Map contributors
          Table of contributors.
protected  Map objectLookup
          Cache of object class contributor search paths; null if none.
 
Constructor Summary
SystemObjectContributorManager()
          Constructs a new contributor manager.
 
Method Summary
protected  List addContributorsFor(Class objectClass)
          Return the list of contributors for the supplied class.
protected  List computeClassOrder(Class extensibleClass)
          Returns the class search order starting with extensibleClass.
protected  List computeInterfaceOrder(List classList)
          Returns the interface search order for the class hierarchy described by classList.
 void flushLookup()
          Flushes the cache of contributor search paths.
protected  Object getAdaptedResource(Object object)
          Get the adapted resource for the supplied object.
 Collection getContributors()
          Get the contributions registered to this manager.
protected  List getContributors(Class objectClass)
          Returns all the contributors registered against the given object class.
protected  List getContributors(Class objectClass, Class resourceClass)
          Returns all the contributors registered against the given object class and the resource class that it has an Adaptable for.
protected  List getContributors(Object object)
          Get the contributors for object including those it adapts to.
 boolean hasContributorsFor(Object object)
          Returns true if contributors exist in the manager for this object.
 boolean isApplicableTo(IStructuredSelection selection, IObjectContributor contributor)
           
 void registerContributor(IObjectContributor contributor, String targetType)
           
 void unregisterAllContributors()
           
 void unregisterContributor(IObjectContributor contributor, String targetType)
           
 void unregisterContributors(String targetType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contributors

protected Map contributors
Table of contributors.


objectLookup

protected Map objectLookup
Cache of object class contributor search paths; null if none.


adapterLookup

protected Map adapterLookup
Cache of resource adapter class contributor search paths; null if none.

Constructor Detail

SystemObjectContributorManager

public SystemObjectContributorManager()
Constructs a new contributor manager.

Method Detail

computeClassOrder

protected final List computeClassOrder(Class extensibleClass)
Returns the class search order starting with extensibleClass. The search order is defined in this class' comment.


computeInterfaceOrder

protected final List computeInterfaceOrder(List classList)
Returns the interface search order for the class hierarchy described by classList. The search order is defined in this class' comment.


flushLookup

public 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.


getContributors

public Collection getContributors()
Get the contributions registered to this manager.

Returns:
an unmodifiable Collection containing all registered contributions. The objects in this Collection will be Lists containing the actual contributions.
Since:
3.0

getContributors

protected List getContributors(Class objectClass)
Returns all the contributors registered against the given object class.


addContributorsFor

protected List addContributorsFor(Class objectClass)
Return the list of contributors for the supplied class.


getContributors

protected List getContributors(Object object)
Get the contributors for object including those it adapts to.

Returns:
The list of contributors, empty if none.

hasContributorsFor

public boolean hasContributorsFor(Object object)
Returns true if contributors exist in the manager for this object.


isApplicableTo

public boolean isApplicableTo(IStructuredSelection selection,
                              IObjectContributor contributor)

registerContributor

public void registerContributor(IObjectContributor contributor,
                                String targetType)
See Also:
IContributorManager#registerContributor

unregisterAllContributors

public void unregisterAllContributors()
See Also:
IContributorManager#unregisterAllContributors

unregisterContributor

public void unregisterContributor(IObjectContributor contributor,
                                  String targetType)
See Also:
IContributorManager#unregisterContributor

unregisterContributors

public void unregisterContributors(String targetType)
See Also:
IContributorManager#unregisterContributors

getContributors

protected List getContributors(Class objectClass,
                               Class resourceClass)
Returns all the contributors registered against the given object class and the resource class that it has an Adaptable for.


getAdaptedResource

protected Object getAdaptedResource(Object object)
Get the adapted resource for the supplied object. If the object is an instance of IResource or is not an instance of IAdaptable return null. Otherwise see if it adapts to IResource via IContributorResourceAdapter.

Parameters:
object - Object
Returns:
an IResource or null

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.