Package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider

## Class TreeCompareInputAdapterFactory

- java.lang.Object
- - org.eclipse.emf.common.notify.impl.AdapterFactoryImpl
  - - org.eclipse.emf.edit.tree.util.TreeAdapterFactory
    - - org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider.TreeCompareInputAdapterFactory

All Implemented Interfaces:
  `AdapterFactory`, `ComposeableAdapterFactory`, `IChangeNotifier`, `IDisposable`

    public class TreeCompareInputAdapterFactory
    extends TreeAdapterFactory
    implements ComposeableAdapterFactory, IChangeNotifier, IDisposable

### Field Summary

Fields
`protected IChangeNotifier` `changeNotifier` This is used to implement `IChangeNotifier`.
`protected Disposable` `disposable` This is used to implement `IDisposable`.
`protected ComposedAdapterFactory` `parentAdapterFactory` This keeps track of the root adapter factory that delegates to this adapter factory.
`protected Collection<Object>` `supportedTypes` This keeps track of all the supported types checked by `isFactoryForType`.

### Fields inherited from class org.eclipse.emf.edit.tree.util.TreeAdapterFactory

`modelPackage, modelSwitch`

### Constructor Summary

Constructors
`TreeCompareInputAdapterFactory()` Creates an `ComposeableAdapterFactory` with the following supported types: `ICompareInput`.

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `adapt​(Object object, Object type)`
`Adapter` `adapt​(Notifier notifier, Object type)` This implementation substitutes the factory itself as the key for the adapter.
`Adapter` `adaptNew​(Notifier object, Object type)` This records adapters for subsequent disposable.
`void` `addListener​(INotifyChangedListener notifyChangedListener)` This adds a listener.
`Adapter` `createTreeNodeAdapter()`
`void` `dispose()` This disposes all the disposables.
`void` `fireNotifyChanged​(Notification notification)` This delegates to `changeNotifier` and to `parentAdapterFactory`.
`ComposeableAdapterFactory` `getRootAdapterFactory()` This returns the root adapter factory that contains this factory.
`boolean` `isFactoryForType​(Object type)`
`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 org.eclipse.emf.edit.tree.util.TreeAdapterFactory

`createAdapter, createEObjectAdapter`

### Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterFactoryImpl

`adaptAllNew, associate, createAdapter, resolve`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.emf.common.notify.AdapterFactory

`adaptAllNew`

### Field Detail

#### parentAdapterFactory

    protected ComposedAdapterFactory parentAdapterFactory

This keeps track of the root adapter factory that delegates to this adapter factory.

#### changeNotifier

    protected final IChangeNotifier changeNotifier

This is used to implement `IChangeNotifier`.

#### disposable

    protected Disposable disposable

This is used to implement `IDisposable`.

#### supportedTypes

    protected final Collection<Object> supportedTypes

This keeps track of all the supported types checked by `isFactoryForType`.

### Constructor Detail

#### TreeCompareInputAdapterFactory

    public TreeCompareInputAdapterFactory()

Creates an `ComposeableAdapterFactory` with the following supported types:

- `ICompareInput`
.

Parameters:
  `grouper` - This will be used by the comparison adapter to group differences together.

### Method Detail

#### isFactoryForType

    public boolean isFactoryForType​(Object type)

Specified by:
  `isFactoryForType` in interface `AdapterFactory`
Overrides:
  `isFactoryForType` in class `TreeAdapterFactory`
See Also:
  `AdapterFactory.isFactoryForType(java.lang.Object)`

#### adapt

    public Adapter adapt​(Notifier notifier,
                         Object type)

This implementation substitutes the factory itself as the key for the adapter.

Specified by:
  `adapt` in interface `AdapterFactory`
Overrides:
  `adapt` in class `AdapterFactoryImpl`
Parameters:
  `notifier` - the notifier to adapt
  `type` - unused
Returns:
  a previously existing associated adapter, a new associated adapter if possible, or `null` otherwise.

#### adapt

    public Object adapt​(Object object,
                        Object type)

Specified by:
  `adapt` in interface `AdapterFactory`
Overrides:
  `adapt` in class `AdapterFactoryImpl`
See Also:
  `AdapterFactoryImpl.adapt(java.lang.Object, java.lang.Object)`

#### getRootAdapterFactory

    public ComposeableAdapterFactory getRootAdapterFactory()

This returns the root adapter factory that contains this factory.

Specified by:
  `getRootAdapterFactory` in interface `ComposeableAdapterFactory`
Returns:
  the root adapter factory that contains this factory.

#### setParentAdapterFactory

    public void setParentAdapterFactory​(ComposedAdapterFactory parentAdapterFactory)

This sets the direct parent adapter factory into which this factory is composed.

Specified by:
  `setParentAdapterFactory` in interface `ComposeableAdapterFactory`
Parameters:
  `parentAdapterFactory` - the direct parent adapter factory into which this factory is composed

#### createTreeNodeAdapter

    public Adapter createTreeNodeAdapter()

Overrides:
  `createTreeNodeAdapter` in class `TreeAdapterFactory`
See Also:
  `TreeAdapterFactory.createTreeNodeAdapter()`

#### adaptNew

    public Adapter adaptNew​(Notifier object,
                            Object type)

This records adapters for subsequent disposable.

Specified by:
  `adaptNew` in interface `AdapterFactory`
Overrides:
  `adaptNew` in class `AdapterFactoryImpl`

#### addListener

    public void addListener​(INotifyChangedListener notifyChangedListener)

This adds a listener.

Specified by:
  `addListener` in interface `IChangeNotifier`

#### removeListener

    public void removeListener​(INotifyChangedListener notifyChangedListener)

This removes a listener.

Specified by:
  `removeListener` in interface `IChangeNotifier`

#### fireNotifyChanged

    public void fireNotifyChanged​(Notification notification)

This delegates to `changeNotifier` and to `parentAdapterFactory`.

Specified by:
  `fireNotifyChanged` in interface `IChangeNotifier`

#### dispose

    public void dispose()

This disposes all the disposables.

Specified by:
  `dispose` in interface `IDisposable`