org.eclipse.gmf.runtime.lite.edit.parts.update
Class TransactionalUpdateManager

java.lang.Object
  extended by org.eclipse.emf.transaction.ResourceSetListenerImpl
      extended by org.eclipse.gmf.runtime.lite.edit.parts.update.TransactionalUpdateManager
All Implemented Interfaces:
EventListener, org.eclipse.emf.transaction.ResourceSetListener, org.eclipse.emf.transaction.ResourceSetListener.Internal

public class TransactionalUpdateManager
extends org.eclipse.emf.transaction.ResourceSetListenerImpl

Manages update for the diagram by requesting refresh of affected edit parts at the end of each transaction. Also manages notation model refreshers which are allowed to contribute their trigger commands before the transaction is committed.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.ResourceSetListener
org.eclipse.emf.transaction.ResourceSetListener.Internal
 
Constructor Summary
TransactionalUpdateManager(org.eclipse.gef.EditPartViewer editPartViewer)
          Creates an instance of TransactionalUpdateManager.
 
Method Summary
 void addNotationModelRefresher(INotationModelRefresher refresher)
           
 void addUpdatableEditPart(org.eclipse.emf.ecore.EObject source, IUpdatableEditPart listener)
          Registers the given updatable edit part as a listener to the given EObject.
 org.eclipse.emf.common.command.Command buildRefreshNotationModelCommand()
          Returns the command that, if applied, synchronizes the notational model with the underlying domain model.
 void dispose()
           
protected  Collection<IUpdatableEditPart> findAffectedParts(org.eclipse.emf.common.notify.Notification msg)
           
protected  org.eclipse.gef.EditPartViewer getEditPartViewer()
           
protected  Collection<IUpdatableEditPart> getRegisteredListeners(org.eclipse.emf.ecore.EObject source)
           
protected  Collection<IUpdatableEditPart> getRegisteredListeners(org.eclipse.emf.common.notify.Notification msg)
           
 void install(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
          Installs the update manager as a listener to the given editing domain.
 boolean isCanonicalStyleEvent(org.eclipse.emf.common.notify.Notification msg)
           
protected  boolean isFiltered(org.eclipse.gmf.runtime.notation.View view)
           
 boolean isInstalled()
          Tells whether the update manager is installed.
 boolean isNotationModelRefresherInstalled(INotationModelRefresher refresher)
           
protected  void processRefreshers(org.eclipse.gmf.runtime.lite.edit.parts.update.ComposeableRefresherImpl affectedRefreshers, IUpdatableEditPart next, org.eclipse.emf.common.notify.Notification msg)
           
 void removeNotationModelRefresher(INotationModelRefresher refresher)
           
 void removeUpdatableEditPart(org.eclipse.emf.ecore.EObject source, IUpdatableEditPart listener)
          Unregisters the given updatable edit part as a listener to the given EObject.
 void resourceSetChanged(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
           
protected  boolean shouldNotifyParent(org.eclipse.emf.common.notify.Notification msg)
           
 org.eclipse.emf.common.command.Command transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
           
 void uninstall()
          Uninstalls the update manager.
 
Methods inherited from class org.eclipse.emf.transaction.ResourceSetListenerImpl
getFilter, getTarget, isAggregatePrecommitListener, isPostcommitOnly, isPrecommitOnly, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalUpdateManager

public TransactionalUpdateManager(org.eclipse.gef.EditPartViewer editPartViewer)
Creates an instance of TransactionalUpdateManager.

Method Detail

install

public void install(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
Installs the update manager as a listener to the given editing domain. The receiver will start listening and dispatching notification to registered refreshers.


isInstalled

public boolean isInstalled()
Tells whether the update manager is installed. Only installed update managers dispatch notifications.


uninstall

public void uninstall()
Uninstalls the update manager. It will stop receiving and dispatching notifications to any listeners.


buildRefreshNotationModelCommand

public org.eclipse.emf.common.command.Command buildRefreshNotationModelCommand()
Returns the command that, if applied, synchronizes the notational model with the underlying domain model.


addNotationModelRefresher

public void addNotationModelRefresher(INotationModelRefresher refresher)

removeNotationModelRefresher

public void removeNotationModelRefresher(INotationModelRefresher refresher)

isNotationModelRefresherInstalled

public boolean isNotationModelRefresherInstalled(INotationModelRefresher refresher)

addUpdatableEditPart

public void addUpdatableEditPart(org.eclipse.emf.ecore.EObject source,
                                 IUpdatableEditPart listener)
Registers the given updatable edit part as a listener to the given EObject.


removeUpdatableEditPart

public void removeUpdatableEditPart(org.eclipse.emf.ecore.EObject source,
                                    IUpdatableEditPart listener)
Unregisters the given updatable edit part as a listener to the given EObject.


dispose

public void dispose()

getRegisteredListeners

protected final Collection<IUpdatableEditPart> getRegisteredListeners(org.eclipse.emf.ecore.EObject source)

getRegisteredListeners

protected final Collection<IUpdatableEditPart> getRegisteredListeners(org.eclipse.emf.common.notify.Notification msg)

transactionAboutToCommit

public org.eclipse.emf.common.command.Command transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
                                                                throws org.eclipse.emf.transaction.RollbackException
Specified by:
transactionAboutToCommit in interface org.eclipse.emf.transaction.ResourceSetListener
Overrides:
transactionAboutToCommit in class org.eclipse.emf.transaction.ResourceSetListenerImpl
Throws:
org.eclipse.emf.transaction.RollbackException

resourceSetChanged

public void resourceSetChanged(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
Specified by:
resourceSetChanged in interface org.eclipse.emf.transaction.ResourceSetListener
Overrides:
resourceSetChanged in class org.eclipse.emf.transaction.ResourceSetListenerImpl

isCanonicalStyleEvent

public boolean isCanonicalStyleEvent(org.eclipse.emf.common.notify.Notification msg)

processRefreshers

protected void processRefreshers(org.eclipse.gmf.runtime.lite.edit.parts.update.ComposeableRefresherImpl affectedRefreshers,
                                 IUpdatableEditPart next,
                                 org.eclipse.emf.common.notify.Notification msg)

getEditPartViewer

protected final org.eclipse.gef.EditPartViewer getEditPartViewer()

findAffectedParts

protected Collection<IUpdatableEditPart> findAffectedParts(org.eclipse.emf.common.notify.Notification msg)

shouldNotifyParent

protected boolean shouldNotifyParent(org.eclipse.emf.common.notify.Notification msg)

isFiltered

protected boolean isFiltered(org.eclipse.gmf.runtime.notation.View view)


Copyright © 2012. All Rights Reserved.