org.eclipse.emf.edit.ui.provider
Class AdapterFactoryContentProvider

java.lang.Object
  extended by org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
All Implemented Interfaces:
org.eclipse.emf.edit.provider.INotifyChangedListener, org.eclipse.jface.viewers.IContentProvider, org.eclipse.jface.viewers.IStructuredContentProvider, org.eclipse.jface.viewers.ITreeContentProvider

public class AdapterFactoryContentProvider
extends Object
implements org.eclipse.jface.viewers.ITreeContentProvider, org.eclipse.emf.edit.provider.INotifyChangedListener

This content provider wraps an AdapterFactory and it delegates its JFace provider interfaces to corresponding adapter-implemented item provider interfaces. All method calls to the various structured content provider interfaces are delegated to interfaces implemented by the adapters generated by the AdapterFactory. IStructuredContentProvider is delegated to IStructuredItemContentProvider; ITreeContentProvider is delegated to ITreeItemContentProvider.


Nested Class Summary
static class AdapterFactoryContentProvider.ViewerRefresh
          A runnable class that efficiently updates a Viewer via standard APIs, based on queued IViewerNotifications from the model's item providers.
 
Constructor Summary
AdapterFactoryContentProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
          This constructs an instance that wraps this factory.
 
Method Summary
 void dispose()
          This discards the content provider and removes this as a listener to the adapterFactory.
 org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()
          This returns the wrapped factory.
 Object[] getChildren(Object object)
          This implements ITreeContentProvider.getChildren to forward the call to an object that implements ITreeItemContentProvider.getChildren.
 Object[] getElements(Object object)
          This implements IStructuredContentProvider.getElements to forward the call to an object that implements IStructuredItemContentProvider.getElements.
 Object getParent(Object object)
          This implements ITreeContentProvider.getParent to forward the call to an object that implements ITreeItemContentProvider.getParent.
 boolean hasChildren(Object object)
          This implements ITreeContentProvider.hasChildren to forward the call to an object that implements ITreeItemContentProvider.hasChildren.
 void inputChanged(org.eclipse.jface.viewers.Viewer viewer, Object oldInput, Object newInput)
          The given Viewer will start (oldInput == null) or stop (newInput == null) listening for domain events.
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
           
 void setAdapterFactory(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
          This sets the wrapped factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdapterFactoryContentProvider

public AdapterFactoryContentProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
This constructs an instance that wraps this factory. The factory should yield adapters that implement the various IItemContentProvider interfaces. If the adapter factory is an IChangeNotifier, a listener is added to it, so it's important to call dispose().

Method Detail

setAdapterFactory

public void setAdapterFactory(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
This sets the wrapped factory. If the adapter factory is an IChangeNotifier, a listener is added to it, so it's important to call dispose().


getAdapterFactory

public org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()
This returns the wrapped factory.


inputChanged

public void inputChanged(org.eclipse.jface.viewers.Viewer viewer,
                         Object oldInput,
                         Object newInput)
The given Viewer will start (oldInput == null) or stop (newInput == null) listening for domain events.

Specified by:
inputChanged in interface org.eclipse.jface.viewers.IContentProvider

getElements

public Object[] getElements(Object object)
This implements IStructuredContentProvider.getElements to forward the call to an object that implements IStructuredItemContentProvider.getElements.

Specified by:
getElements in interface org.eclipse.jface.viewers.IStructuredContentProvider
Specified by:
getElements in interface org.eclipse.jface.viewers.ITreeContentProvider

getChildren

public Object[] getChildren(Object object)
This implements ITreeContentProvider.getChildren to forward the call to an object that implements ITreeItemContentProvider.getChildren.

Specified by:
getChildren in interface org.eclipse.jface.viewers.ITreeContentProvider

hasChildren

public boolean hasChildren(Object object)
This implements ITreeContentProvider.hasChildren to forward the call to an object that implements ITreeItemContentProvider.hasChildren.

Specified by:
hasChildren in interface org.eclipse.jface.viewers.ITreeContentProvider

getParent

public Object getParent(Object object)
This implements ITreeContentProvider.getParent to forward the call to an object that implements ITreeItemContentProvider.getParent.

Specified by:
getParent in interface org.eclipse.jface.viewers.ITreeContentProvider

dispose

public void dispose()
This discards the content provider and removes this as a listener to the adapterFactory.

Specified by:
dispose in interface org.eclipse.jface.viewers.IContentProvider

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
Specified by:
notifyChanged in interface org.eclipse.emf.edit.provider.INotifyChangedListener


Copyright © 2014. All Rights Reserved.