org.eclipse.emf.transaction.ui.provider
Class TransactionalAdapterFactoryContentProvider

java.lang.Object
  extended byorg.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
      extended byorg.eclipse.emf.transaction.ui.provider.TransactionalAdapterFactoryContentProvider
All Implemented Interfaces:
org.eclipse.jface.viewers.IContentProvider, org.eclipse.emf.edit.provider.INotifyChangedListener, org.eclipse.ui.views.properties.IPropertySourceProvider, org.eclipse.jface.viewers.IStructuredContentProvider, org.eclipse.jface.viewers.ITreeContentProvider

public class TransactionalAdapterFactoryContentProvider
extends org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider

Automatically wraps any potential access to model objects in read transactions. Note that this is not necessary in the case of the AdapterFactoryContentProvider.notifyChanged(Notification) method because this will always be called in a transaction context.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.ViewerRefresh
 
Field Summary
 
Fields inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
adapterFactory, viewer, viewerRefresh
 
Constructor Summary
TransactionalAdapterFactoryContentProvider(TransactionalEditingDomain domain, org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
          Initializes me with the editing domain in which I create read transactions and that adapter factory that provides content providers.
 
Method Summary
protected  org.eclipse.ui.views.properties.IPropertySource createPropertySource(Object object, org.eclipse.emf.edit.provider.IItemPropertySource itemPropertySource)
          Extends the inherited implementation by running in a read-only transaction.
 Object[] getChildren(Object object)
          Extends the inherited implementation by running in a read-only transaction.
 Object[] getElements(Object object)
          Extends the inherited implementation by running in a read-only transaction.
 Object getParent(Object object)
          Extends the inherited implementation by running in a read-only transaction.
 org.eclipse.ui.views.properties.IPropertySource getPropertySource(Object object)
          Extends the inherited implementation by running in a read-only transaction.
 boolean hasChildren(Object object)
          Extends the inherited implementation by running in a read-only transaction.
 void inputChanged(org.eclipse.jface.viewers.Viewer vwr, Object oldInput, Object newInput)
          Extends the inherited implementation by running in a read-only transaction.
protected  Object run(RunnableWithResult run)
          Runs the specified runnable in the editing domain, with interrupt handling.
protected  org.eclipse.ui.views.properties.IPropertySource wrap(org.eclipse.ui.views.properties.IPropertySource propertySource)
          Wraps a property source in a transactional property source.
 
Methods inherited from class org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider
dispose, getAdapterFactory, notifyChanged, setAdapterFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalAdapterFactoryContentProvider

public TransactionalAdapterFactoryContentProvider(TransactionalEditingDomain domain,
                                                  org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
Initializes me with the editing domain in which I create read transactions and that adapter factory that provides content providers.

Parameters:
domain - my editing domain
adapterFactory - the adapter factory
Method Detail

run

protected Object run(RunnableWithResult run)
Runs the specified runnable in the editing domain, with interrupt handling.

Parameters:
run - the runnable to run
Returns:
its result, or null on interrupt

createPropertySource

protected org.eclipse.ui.views.properties.IPropertySource createPropertySource(Object object,
                                                                               org.eclipse.emf.edit.provider.IItemPropertySource itemPropertySource)
Extends the inherited implementation by running in a read-only transaction. The returned property source also uses transactions to access properties.


getChildren

public Object[] getChildren(Object object)
Extends the inherited implementation by running in a read-only transaction.


getElements

public Object[] getElements(Object object)
Extends the inherited implementation by running in a read-only transaction.


getParent

public Object getParent(Object object)
Extends the inherited implementation by running in a read-only transaction.


getPropertySource

public org.eclipse.ui.views.properties.IPropertySource getPropertySource(Object object)
Extends the inherited implementation by running in a read-only transaction. The returned property source also uses transactions to access properties.


hasChildren

public boolean hasChildren(Object object)
Extends the inherited implementation by running in a read-only transaction.


inputChanged

public void inputChanged(org.eclipse.jface.viewers.Viewer vwr,
                         Object oldInput,
                         Object newInput)
Extends the inherited implementation by running in a read-only transaction.


wrap

protected org.eclipse.ui.views.properties.IPropertySource wrap(org.eclipse.ui.views.properties.IPropertySource propertySource)
Wraps a property source in a transactional property source.

Parameters:
propertySource - the property source to wrap
Returns:
a wrapper that delegates to the original property source within transactions

Copyright 2002, 2006 IBM Corporation and others.
All Rights Reserved.