org.eclipse.emf.emfstore.internal.client.observers
Class SimpleOperationObserver

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.observers.SimpleOperationObserver
All Implemented Interfaces:
ESCommitObserver, ESObserver, OperationObserver

public abstract class SimpleOperationObserver
extends Object
implements OperationObserver, ESCommitObserver

Clients (like GUI classes) who are not interested if an operation has been run forward or backward (i.e. undone) can use this add this listener to project space.

Author:
hodaie

Constructor Summary
SimpleOperationObserver()
           
 
Method Summary
 void commitCompleted(ESLocalProject localProject, ESPrimaryVersionSpec newRevision, org.eclipse.core.runtime.IProgressMonitor monitor)
          Called after the commit is completed.
 boolean inspectChanges(ESLocalProject localProject, ESChangePackage changePackage, org.eclipse.core.runtime.IProgressMonitor monitor)
          Called before the commit proceeds.
 void operationExecuted(AbstractOperation operation)
          Called when an AbstractOperation has been executed.
abstract  void operationPerformed(AbstractOperation operation)
          Called when an operation has been executed, either forward or backwards (i.e.
 void operationUndone(AbstractOperation operation)
          Called when an AbstractOperation has been reversed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOperationObserver

public SimpleOperationObserver()
Method Detail

commitCompleted

public void commitCompleted(ESLocalProject localProject,
                            ESPrimaryVersionSpec newRevision,
                            org.eclipse.core.runtime.IProgressMonitor monitor)
Called after the commit is completed.

Specified by:
commitCompleted in interface ESCommitObserver
Parameters:
localProject - the project on which the commit has completed
newRevision - the new revision that was created by the commit
monitor - an IProgressMonitor instance that may be used by clients to inform about progress
See Also:
ESCommitObserver.commitCompleted(org.eclipse.emf.emfstore.client.ESLocalProject, org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

inspectChanges

public boolean inspectChanges(ESLocalProject localProject,
                              ESChangePackage changePackage,
                              org.eclipse.core.runtime.IProgressMonitor monitor)
Called before the commit proceeds. A callback method to initiate the commit dialog and allow the user to confirm the changes.

Specified by:
inspectChanges in interface ESCommitObserver
Parameters:
localProject - the project the commit occurs on
changePackage - the ESChangePackage
monitor - an IProgressMonitor instance that may be used by clients to inform about progress
Returns:
true if the changes have been confirmed, false - otherwise.
See Also:
ESCommitObserver.inspectChanges(org.eclipse.emf.emfstore.client.ESLocalProject, org.eclipse.emf.emfstore.server.model.ESChangePackage, org.eclipse.core.runtime.IProgressMonitor)

operationExecuted

public void operationExecuted(AbstractOperation operation)
Called when an AbstractOperation has been executed.

Specified by:
operationExecuted in interface OperationObserver
Parameters:
operation - the executed operation
See Also:
OperationObserver.operationExecuted(org.eclipse.emf.emfstore.internal.server.model.versioning.operations.AbstractOperation)

operationUndone

public void operationUndone(AbstractOperation operation)
Called when an AbstractOperation has been reversed.

Specified by:
operationUndone in interface OperationObserver
Parameters:
operation - the operation that has been reversed.
Note: the given operation is not reserved. If you wish to get the reversed operation, call AbstractOperation.reverse() on operation
See Also:
OperationObserver.operationUndone(org.eclipse.emf.emfstore.internal.server.model.versioning.operations.AbstractOperation)

operationPerformed

public abstract void operationPerformed(AbstractOperation operation)
Called when an operation has been executed, either forward or backwards (i.e. undo).

Parameters:
operation - the executed operation


Copyright © 2015. All Rights Reserved.