|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.edit.provider.ComposedAdapterFactory
public class ComposedAdapterFactory
This provides support for composing several factories for different models into a single factory serving the union of the model objects.
Nested Class Summary | |
---|---|
static interface |
ComposedAdapterFactory.Descriptor
A descriptor can create an adapter factory. |
Field Summary | |
---|---|
protected java.util.List<AdapterFactory> |
adapterFactories
This keeps track of all the AdapterFactory delegates. |
protected ComposedAdapterFactory.Descriptor.Registry |
adapterFactoryDescriptorRegistry
This is used to demand create adapter factories from a registry. |
protected ChangeNotifier |
changeNotifier
This is used to implement IChangeNotifier |
protected ComposedAdapterFactory |
parentAdapterFactory
This is used to implement the ComposeableAdapterFactory interface. |
Constructor Summary | |
---|---|
ComposedAdapterFactory()
|
|
ComposedAdapterFactory(AdapterFactory adapterFactory)
|
|
ComposedAdapterFactory(AdapterFactory[] adapterFactories)
|
|
ComposedAdapterFactory(java.util.Collection<? extends AdapterFactory> adapterFactories)
|
|
ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry adapterFactoryDescriptorRegistry)
|
Method Summary | |
---|---|
Adapter |
adapt(Notifier target,
java.lang.Object type)
Returns either a previously associated adapter or a newly associated adapter, as appropriate. |
protected Adapter |
adapt(Notifier target,
java.lang.Object type,
boolean isNew)
|
protected Adapter |
adapt(Notifier target,
java.lang.Object type,
java.util.Collection<java.lang.Object> failedPackages,
java.lang.Class<?> javaClass)
|
protected Adapter |
adapt(Notifier target,
java.lang.Object type,
java.util.Collection<java.lang.Object> failedPackages,
java.lang.Class<?> javaClass,
boolean isNew)
|
java.lang.Object |
adapt(java.lang.Object target,
java.lang.Object type)
Returns either an associated adapter for the object, or the object itself, depending on whether the object is a notifier that supports an adapter of the given type. |
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)
Creates a new associated adapter of the given type; it may optionally call setTarget on the adapter,
and it may optionally add the adapter to the target.eAdapters() . |
void |
addAdapterFactory(AdapterFactory adapterFactory)
|
void |
addListener(INotifyChangedListener notifyChangedListener)
This adds another listener. |
protected AdapterFactory |
delegatedGetFactoryForTypes(java.util.Collection<?> types)
|
void |
dispose()
This is called to dispose the object. |
void |
fireNotifyChanged(Notification notification)
This calls notifyChanged for each listener. |
AdapterFactory |
getFactoryForType(java.lang.Object type)
|
AdapterFactory |
getFactoryForTypes(java.util.Collection<?> types)
|
ComposeableAdapterFactory |
getRootAdapterFactory()
This returns the root adapter factory that delegates to this factory. |
void |
insertAdapterFactory(AdapterFactory adapterFactory)
|
boolean |
isFactoryForType(java.lang.Object type)
Returns whether this factory supports adapters for the given type. |
void |
removeAdapterFactory(AdapterFactory adapterFactory)
|
void |
removeListener(INotifyChangedListener notifyChangedListener)
This removes a listener. |
void |
setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
This sets the direct parent adapter factory into which this factory is composed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<AdapterFactory> adapterFactories
AdapterFactory
delegates.
protected ComposedAdapterFactory parentAdapterFactory
ComposeableAdapterFactory
interface.
protected ChangeNotifier changeNotifier
IChangeNotifier
protected ComposedAdapterFactory.Descriptor.Registry adapterFactoryDescriptorRegistry
Constructor Detail |
---|
public ComposedAdapterFactory()
public ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry adapterFactoryDescriptorRegistry)
public ComposedAdapterFactory(AdapterFactory adapterFactory)
public ComposedAdapterFactory(AdapterFactory[] adapterFactories)
public ComposedAdapterFactory(java.util.Collection<? extends AdapterFactory> adapterFactories)
Method Detail |
---|
public boolean isFactoryForType(java.lang.Object type)
AdapterFactory
isFactoryForType
in interface AdapterFactory
type
- the key indicating the type of adapter in question.
Adapter.isAdapterForType(java.lang.Object)
public AdapterFactory getFactoryForType(java.lang.Object type)
public AdapterFactory getFactoryForTypes(java.util.Collection<?> types)
protected AdapterFactory delegatedGetFactoryForTypes(java.util.Collection<?> types)
public java.lang.Object adapt(java.lang.Object target, java.lang.Object type)
AdapterFactory
adapt
in interface AdapterFactory
target
- arbitrary object to adapt.type
- the key indicating the type of adapter required.
public Adapter adapt(Notifier target, java.lang.Object type)
AdapterFactory
create
a new adapter.
adapt
in interface AdapterFactory
target
- the notifier to adapt.type
- the key indicating the type of adapter required.
Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)
,
AdapterFactory.adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
protected Adapter adapt(Notifier target, java.lang.Object type, boolean isNew)
protected Adapter adapt(Notifier target, java.lang.Object type, java.util.Collection<java.lang.Object> failedPackages, java.lang.Class<?> javaClass)
protected Adapter adapt(Notifier target, java.lang.Object type, java.util.Collection<java.lang.Object> failedPackages, java.lang.Class<?> javaClass, boolean isNew)
public Adapter adaptNew(Notifier target, java.lang.Object type)
AdapterFactory
setTarget
on the adapter,
and it may optionally add the adapter to the target.eAdapters()
.
This is typically not called directly by clients.
adaptNew
in interface AdapterFactory
target
- the notifier to adapt.type
- the key indicating the type of adapter required.
Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)
,
Notifier.eAdapters()
public void adaptAllNew(Notifier target)
AdapterFactory
adaptAllNew
in interface AdapterFactory
target
- notifier to adapt.AdapterFactory.adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
public void insertAdapterFactory(AdapterFactory adapterFactory)
public void addAdapterFactory(AdapterFactory adapterFactory)
public void removeAdapterFactory(AdapterFactory adapterFactory)
public ComposeableAdapterFactory getRootAdapterFactory()
getRootAdapterFactory
in interface ComposeableAdapterFactory
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
setParentAdapterFactory
in interface ComposeableAdapterFactory
public void addListener(INotifyChangedListener notifyChangedListener)
IChangeNotifier
addListener
in interface IChangeNotifier
public void removeListener(INotifyChangedListener notifyChangedListener)
IChangeNotifier
removeListener
in interface IChangeNotifier
public void fireNotifyChanged(Notification notification)
IChangeNotifier
notifyChanged
for each listener.
fireNotifyChanged
in interface IChangeNotifier
public void dispose()
IDisposable
dispose
in interface IDisposable
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |