public abstract class DecoratorAdapterFactory extends java.lang.Object implements AdapterFactory, ComposeableAdapterFactory, IChangeNotifier, IDisposable
IItemProviderDecorators
for the adapters created by another AdapterFactory.| Modifier and Type | Field and Description |
|---|---|
protected ChangeNotifier |
changeNotifier
This keeps track of all the Viewers.
|
protected AdapterFactory |
decoratedAdapterFactory
This keeps the
AdapterFactory being decorated. |
protected java.util.HashMap<java.lang.Object,IItemProviderDecorator> |
itemProviderDecorators |
protected ComposedAdapterFactory |
parentAdapterFactory
This is used to implement the
ComposeableAdapterFactory interface. |
| Constructor and Description |
|---|
DecoratorAdapterFactory(AdapterFactory decoratedAdapterFactory)
This creates an instance that decorates the adapters from the given adapter factory.
|
| Modifier and Type | Method and Description |
|---|---|
Adapter |
adapt(Notifier target,
java.lang.Object type)
This delegates to
adapt(Object,Object) |
java.lang.Object |
adapt(java.lang.Object target,
java.lang.Object type)
All adapter creation is delegated to this method, which yields decorated item providers.
|
void |
adaptAllNew(Notifier target)
Creates a new associated adapter of each type of adapter supported by this factory, as necessary.
|
Adapter |
adaptNew(Notifier target,
java.lang.Object type)
This interface is not support; an exception will be thrown.
|
void |
addListener(INotifyChangedListener notifyChangedListener)
This adds another listener.
|
protected abstract IItemProviderDecorator |
createItemProviderDecorator(java.lang.Object target,
java.lang.Object Type)
This is called when a new decorator is needed by
adapt(Object,Object). |
void |
dispose()
This is called to dispose the object.
|
void |
fireNotifyChanged(Notification notification)
This calls
notifyChanged for each listener. |
AdapterFactory |
getDecoratedAdapterFactory()
This returns the adapter factory whose adapters are being decorated.
|
ComposeableAdapterFactory |
getRootAdapterFactory()
This returns the root adapter factory that delegates to this factory.
|
boolean |
isFactoryForType(java.lang.Object type)
This just delegates to the
decoratedAdapterFactory. |
void |
removeListener(INotifyChangedListener notifyChangedListener)
This removes a listener.
|
void |
setDecoratedAdapterFactory(AdapterFactory decoratedAdapterFactory)
This sets the adapter factory whose adapters will be decorated.
|
void |
setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
This sets the direct parent adapter factory into which this factory is composed.
|
protected java.util.HashMap<java.lang.Object,IItemProviderDecorator> itemProviderDecorators
protected AdapterFactory decoratedAdapterFactory
AdapterFactory being decorated.protected ComposedAdapterFactory parentAdapterFactory
ComposeableAdapterFactory interface.protected ChangeNotifier changeNotifier
public DecoratorAdapterFactory(AdapterFactory decoratedAdapterFactory)
public boolean isFactoryForType(java.lang.Object type)
decoratedAdapterFactory.isFactoryForType in interface AdapterFactorytype - the key indicating the type of adapter in question.Adapter.isAdapterForType(java.lang.Object)public AdapterFactory getDecoratedAdapterFactory()
public void setDecoratedAdapterFactory(AdapterFactory decoratedAdapterFactory)
protected abstract IItemProviderDecorator createItemProviderDecorator(java.lang.Object target, java.lang.Object Type)
adapt(Object,Object).public java.lang.Object adapt(java.lang.Object target,
java.lang.Object type)
createItemProviderDecorator(java.lang.Object, java.lang.Object)
to the adapters returned by decoratedAdapterFactory.adapt in interface AdapterFactorytarget - arbitrary object to adapt.type - the key indicating the type of adapter required.null if the type isn't supported or the object cannot be adapted to it.public Adapter adapt(Notifier target, java.lang.Object type)
adapt(Object,Object)adapt in interface AdapterFactorytarget - the notifier to adapt.type - the key indicating the type of adapter required.null otherwise.Adapter.setTarget(org.eclipse.emf.common.notify.Notifier),
AdapterFactory.adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)public Adapter adaptNew(Notifier target, java.lang.Object type)
adaptNew in interface AdapterFactorytarget - the notifier to adapt.type - the key indicating the type of adapter required.null otherwise.Adapter.setTarget(org.eclipse.emf.common.notify.Notifier),
Notifier.eAdapters()public void adaptAllNew(Notifier target)
AdapterFactoryadaptAllNew in interface AdapterFactorytarget - notifier to adapt.AdapterFactory.adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)public ComposeableAdapterFactory getRootAdapterFactory()
getRootAdapterFactory in interface ComposeableAdapterFactorypublic void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
setParentAdapterFactory in interface ComposeableAdapterFactorypublic void addListener(INotifyChangedListener notifyChangedListener)
IChangeNotifieraddListener in interface IChangeNotifierpublic void removeListener(INotifyChangedListener notifyChangedListener)
IChangeNotifierremoveListener in interface IChangeNotifierpublic void fireNotifyChanged(Notification notification)
IChangeNotifiernotifyChanged for each listener.fireNotifyChanged in interface IChangeNotifierpublic void dispose()
IDisposabledispose in interface IDisposable