public abstract class AbstractSharedObjectContainerAdapterFactory extends AbstractContainerAdapterFactory
IAdapterFactory interface. It checks that the first parameter of the
AbstractContainerAdapterFactory.getAdapter(Object, Class) method (adaptableObject) is an instance of
ISharedObjectContainer. If it is, then the method
getSharedObjectAdapter(ISharedObjectContainer, Class) is called with
the ISharedObjectContainer and Class passed in as arguments.| Modifier and Type | Field and Description |
|---|---|
protected static int |
ADD_ADAPTER_ERROR_CODE |
protected static String |
ADD_ADAPTER_ERROR_MESSAGE |
| Constructor and Description |
|---|
AbstractSharedObjectContainerAdapterFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract ISharedObject |
createAdapter(ISharedObjectContainer container,
Class adapterType,
ID adapterID)
Create an adapter instance that implements
ISharedObject and
adapterType. |
protected ID |
createAdapterID(ISharedObjectContainer container,
Class adapterType)
Get the adapterID for the given adapterType
|
protected Map |
createAdapterProperties(ISharedObjectContainer container,
Class adapterType,
ID sharedObjectID,
ISharedObject sharedObjectAdapter)
Get properties to associate with new shared object adapter creation
|
abstract Class[] |
getAdapterList() |
protected Object |
getContainerAdapter(IContainer container,
Class adapterType)
Method called by implementation of
AbstractContainerAdapterFactory.getAdapter(Object, Class) if the
adaptableObject is an instance of IContainer. |
protected ISharedObject |
getSharedObjectAdapter(ISharedObjectContainer container,
Class adapterType)
Get the
ISharedObject adapter for given
ISharedObjectContainer. |
getAdapterprotected static final int ADD_ADAPTER_ERROR_CODE
protected static final String ADD_ADAPTER_ERROR_MESSAGE
public AbstractSharedObjectContainerAdapterFactory()
protected Object getContainerAdapter(IContainer container, Class adapterType)
AbstractContainerAdapterFactoryAbstractContainerAdapterFactory.getAdapter(Object, Class) if the
adaptableObject is an instance of IContainer. Subclasses should implement to
return the proper container adapter object based upon the given adapterType.getContainerAdapter in class AbstractContainerAdapterFactorycontainer - the IContainer adaptable object provided to the adapter. Will not be null.adapterType - the type (interface) of the adapter on the given container. Will not be nullnull.protected ISharedObject getSharedObjectAdapter(ISharedObjectContainer container, Class adapterType)
ISharedObject adapter for given
ISharedObjectContainer. The resulting ISharedObject must
also implement the adapterType interface. Once called, this
method will call the following methods in order:
createAdapterID(ISharedObjectContainer, Class)
createAdapter(ISharedObjectContainer, Class, ID)
createAdapterProperties(ISharedObjectContainer, Class, ID, ISharedObject)container - the ISharedObjectContainer that will hold the new
ISharedObject adapteradapterType - the type that the ISharedObject must also implement to
be an adapterprotected Map createAdapterProperties(ISharedObjectContainer container, Class adapterType, ID sharedObjectID, ISharedObject sharedObjectAdapter)
container - the container that will contain the new adapter shared objectadapterType - the adapterType for the new shared objectsharedObjectID - the ID for the new shared object adaptersharedObjectAdapter - the new shared object adapterprotected ID createAdapterID(ISharedObjectContainer container, Class adapterType)
container - the container the adapter will be added toadapterType - the type of the adaptergetSharedObjectAdapter(ISharedObjectContainer, Class)
will also return nullprotected abstract ISharedObject createAdapter(ISharedObjectContainer container, Class adapterType, ID adapterID)
ISharedObject and
adapterType. The resulting instance must implement both
ISharedObject and adapterTypecontainer - the container that will contain the new adapter instanceadapterType - the adapter type. The returned value must implement this
interfaceadapterID - the ID to use for the new adaptergetSharedObjectAdapter(ISharedObjectContainer, Class)
will also return nullpublic abstract Class[] getAdapterList()
getAdapterList in interface org.eclipse.core.runtime.IAdapterFactorygetAdapterList in class AbstractContainerAdapterFactoryCopyright © 2004–2020 Eclipse Foundation. All rights reserved.