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

## Class EMFCompareStructureMergeViewerContentProvider

- java.lang.Object
- - org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
  - - org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewerContentProvider

All Implemented Interfaces:
  org.eclipse.core.runtime.jobs.IJobChangeListener, INotifyChangedListener, org.eclipse.jface.viewers.IContentProvider, org.eclipse.jface.viewers.IStructuredContentProvider, org.eclipse.jface.viewers.ITreeContentProvider, org.eclipse.ui.views.properties.IPropertySourceProvider

    public class EMFCompareStructureMergeViewerContentProvider
    extends AdapterFactoryContentProvider
    implements org.eclipse.core.runtime.jobs.IJobChangeListener

Specialized AdapterFactoryContentProvider for the emf compare structure merge viewer.

This class is not intended to be used outside of its package. It has been set to public for testing purpose only.

### Nested Class Summary

Nested Classes
`static class` `EMFCompareStructureMergeViewerContentProvider.CallbackType` Enum used for better readability of the method `runWhenReady(CallbackType, Runnable)`.

### Nested classes/interfaces inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider

`AdapterFactoryContentProvider.ViewerRefresh`

### Field Summary

### Fields inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider

`adapterFactory, viewer, viewerRefresh`

### Constructor Summary

Constructors
Constructor and Description
`EMFCompareStructureMergeViewerContentProvider(AdapterFactory adapterFactory, org.eclipse.jface.viewers.AbstractTreeViewer viewer)` Constructs the content provider with the appropriate adapter factory.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `aboutToRun(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`
`boolean` `addFetchingListener(org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewerContentProvider.FetchListener listener)` Adds a listener to this content provider.
`void` `awake(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`
`void` `dispose()`
`void` `done(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`
`Object[]` `getChildren(Object element)`
`Object[]` `getElements(Object element)`
`Object` `getParent(Object element)`
`boolean` `hasChildren(Object element)`
`boolean` `removeFetchingListener(org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewerContentProvider.FetchListener listener)` Removes a listener to this content provider.
`void` `running(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`
`void` `runWhenReady(EMFCompareStructureMergeViewerContentProvider.CallbackType type, Runnable runnable)` Run the given runnable in the specified thread when then content provider is ready.
`void` `scheduled(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`
`void` `sleeping(org.eclipse.core.runtime.jobs.IJobChangeEvent event)`

### Methods inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider

`createPropertySource, getAdapterFactory, getPropertySource, inputChanged, notifyChanged, setAdapterFactory`

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

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

### Constructor Detail

#### EMFCompareStructureMergeViewerContentProvider

    public EMFCompareStructureMergeViewerContentProvider(AdapterFactory adapterFactory,
                                                         org.eclipse.jface.viewers.AbstractTreeViewer viewer)

Constructs the content provider with the appropriate adapter factory.

Parameters:
  `adapterFactory` - The adapter factory used to construct the content provider.

### Method Detail

#### getParent

    public Object getParent(Object element)

Specified by:
  `getParent` in interface `org.eclipse.jface.viewers.ITreeContentProvider`
Overrides:
  `getParent` in class `AdapterFactoryContentProvider`
See Also:
  `AdapterFactoryContentProvider.getParent(Object object)`

#### runWhenReady

    public void runWhenReady(EMFCompareStructureMergeViewerContentProvider.CallbackType type,
                             Runnable runnable)

Run the given runnable in the specified thread when then content provider is ready. It can be run directly if the content provider is not fecthing or during a callback when the content provider is done fetching.

Parameters:
  `type` - of thread to run the `Runnable` inside.
  `runnable` - to run

#### addFetchingListener

    public boolean addFetchingListener(org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewerContentProvider.FetchListener listener)

Adds a listener to this content provider.

Parameters:
  `listener` - to add
Returns:

#### removeFetchingListener

    public boolean removeFetchingListener(org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewerContentProvider.FetchListener listener)

Removes a listener to this content provider.

Parameters:
  `listener` - to remove
Returns:

#### hasChildren

    public final boolean hasChildren(Object element)

Specified by:
  `hasChildren` in interface `org.eclipse.jface.viewers.ITreeContentProvider`
Overrides:
  `hasChildren` in class `AdapterFactoryContentProvider`
See Also:
  `AdapterFactoryContentProvider.hasChildren(Object object)`

#### getChildren

    public final Object[] getChildren(Object element)

Specified by:
  `getChildren` in interface `org.eclipse.jface.viewers.ITreeContentProvider`
Overrides:
  `getChildren` in class `AdapterFactoryContentProvider`
See Also:
  `AdapterFactoryContentProvider.getChildren(java.lang.Object)`

#### getElements

    public Object[] getElements(Object element)

Specified by:
  `getElements` in interface `org.eclipse.jface.viewers.IStructuredContentProvider`
Specified by:
  `getElements` in interface `org.eclipse.jface.viewers.ITreeContentProvider`
Overrides:
  `getElements` in class `AdapterFactoryContentProvider`
See Also:
  `AdapterFactoryContentProvider.getElements(Object object)`

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `org.eclipse.jface.viewers.IContentProvider`
Overrides:
  `dispose` in class `AdapterFactoryContentProvider`
See Also:
  `IContentProvider.dispose()`

#### aboutToRun

    public void aboutToRun(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `aboutToRun` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `#aboutToRun(IJobChangeEvent)`

#### awake

    public void awake(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `awake` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `IJobChangeListener.awake(IJobChangeEvent)`

#### done

    public void done(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `done` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `IJobChangeListener.done(IJobChangeEvent)`

#### running

    public void running(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `running` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `IJobChangeListener.running(IJobChangeEvent)`

#### scheduled

    public void scheduled(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `scheduled` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `IJobChangeListener.scheduled(IJobChangeEvent)`

#### sleeping

    public void sleeping(org.eclipse.core.runtime.jobs.IJobChangeEvent event)

Specified by:
  `sleeping` in interface `org.eclipse.core.runtime.jobs.IJobChangeListener`
See Also:
  `IJobChangeListener.sleeping(IJobChangeEvent)`