|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager
public class OperationManager
This class acts as a simple wrapper around the operation recorder and provides convenience methods for undoing operations and handling composite operations.
Constructor Summary | |
---|---|
OperationManager(ProjectSpaceBase projectSpace)
Constructor. |
Method Summary | |
---|---|
void |
abortCompositeOperation()
Aborts the current composite operation. |
void |
addOperationObserver(OperationObserver operationObserver)
Adds an operation observer that gets notified whenever an operation is either executed or undone. |
CompositeOperationHandle |
beginCompositeOperation()
Opens up a handle for creating a composite operation. |
List<AbstractOperation> |
clearOperations()
Clears all recorded operations. |
void |
collectionDeleted(IdEObjectCollection collection)
If the IdEObjectCollection is deleted. |
void |
commandCompleted(org.eclipse.emf.common.command.Command command)
Called to notify listener about the successful completion of the given command. |
void |
commandCompleted(org.eclipse.emf.common.command.Command command,
boolean isNestedCommand)
Notifies the manager that a command has been completed. |
void |
commandFailed(org.eclipse.emf.common.command.Command command,
Exception exception)
Called to notify listener about the failure of the given command. |
void |
commandStarted(org.eclipse.emf.common.command.Command command)
Called to notify listener about the start of the given command. |
void |
dispose()
Marker method for classes that need to perform clean-up tasks. |
void |
endCompositeOperation()
Complete the current composite operation. |
void |
endCompositeOperation(SemanticCompositeOperation semanticCompositeOperation)
Replace and complete the current composite operation. |
NotificationRecorder |
getNotificationRecorder()
Returns the notification recorder. |
OperationRecorderConfig |
getRecorderConfig()
Returns the configuration options for the operation recorder. |
boolean |
isCommandRunning()
Whether the operation manager considers a command is being run. |
void |
modelElementAdded(IdEObjectCollection collection,
org.eclipse.emf.ecore.EObject modelElement)
Called when the eObject has been added to the collection . |
void |
modelElementRemoved(IdEObjectCollection collection,
org.eclipse.emf.ecore.EObject modelElement)
Called when the eObject and its siblings have been removed from
the collection . |
void |
notify(org.eclipse.emf.common.notify.Notification notification,
IdEObjectCollection collection,
org.eclipse.emf.ecore.EObject modelElement)
A notification on a model element of the collection occurred. |
void |
notifyOperationUndone(AbstractOperation operation)
Notifies all operations observer that an operation has been undone. |
void |
operationsRecorded(List<? extends AbstractOperation> operations)
Notify observer about recorded operations. |
void |
removeOperationListener(OperationObserver operationObserver)
Removed the given operation observer from the list of operation observers. |
void |
startChangeRecording()
Starts change recording. |
void |
stopChangeRecording()
Stops change recording. |
void |
undoLastOperation()
Undo the last operation of the projectSpace. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OperationManager(ProjectSpaceBase projectSpace)
projectSpace
- the project space the operation manager should be attached toMethod Detail |
---|
public void undoLastOperation()
public void addOperationObserver(OperationObserver operationObserver)
operationObserver
- the operation observer to be addedpublic void removeOperationListener(OperationObserver operationObserver)
operationObserver
- the operation observer to be removedpublic void notifyOperationUndone(AbstractOperation operation)
operation
- the operation that has been undonepublic void abortCompositeOperation()
public void endCompositeOperation()
public void endCompositeOperation(SemanticCompositeOperation semanticCompositeOperation)
semanticCompositeOperation
- the semantic operation that replaces the composite operationpublic CompositeOperationHandle beginCompositeOperation()
public void operationsRecorded(List<? extends AbstractOperation> operations)
operationsRecorded
in interface OperationRecorderListener
operations
- a list of operationsOperationRecorderListener.operationsRecorded(java.util.List)
public List<AbstractOperation> clearOperations()
public void dispose()
dispose
in interface ESDisposable
ESDisposable.dispose()
public NotificationRecorder getNotificationRecorder()
public void commandStarted(org.eclipse.emf.common.command.Command command)
commandStarted
in interface ESCommandObserver
command
- the commandESCommandObserver.commandStarted(org.eclipse.emf.common.command.Command)
public void commandCompleted(org.eclipse.emf.common.command.Command command)
commandCompleted
in interface ESCommandObserver
command
- the commandESCommandObserver.commandCompleted(org.eclipse.emf.common.command.Command)
public void commandFailed(org.eclipse.emf.common.command.Command command, Exception exception)
commandFailed
in interface ESCommandObserver
command
- the commandexception
- the exception that occurredESCommandObserver.commandFailed(org.eclipse.emf.common.command.Command,
java.lang.Exception)
public void notify(org.eclipse.emf.common.notify.Notification notification, IdEObjectCollection collection, org.eclipse.emf.ecore.EObject modelElement)
Notification
documentation for details on the notifications.
This method will be called even if the given notification results from an add
or remove of a model element of the project.
notify
in interface IdEObjectCollectionChangeObserver
notification
- the notificationcollection
- the collection holding the modelElement
modelElement
- the model element the notification originates fromIdEObjectCollectionChangeObserver.notify(org.eclipse.emf.common.notify.Notification,
org.eclipse.emf.emfstore.internal.common.model.IdEObjectCollection, org.eclipse.emf.ecore.EObject)
public void modelElementAdded(IdEObjectCollection collection, org.eclipse.emf.ecore.EObject modelElement)
eObject
has been added to the collection
.
modelElementAdded
in interface IdEObjectCollectionChangeObserver
collection
- the IdEObjectCollection
to which the eObject
was addedmodelElement
- the EObject
that has been added to the collection
IdEObjectCollectionChangeObserver.modelElementAdded(org.eclipse.emf.emfstore.internal.common.model.IdEObjectCollection,
org.eclipse.emf.ecore.EObject)
public void modelElementRemoved(IdEObjectCollection collection, org.eclipse.emf.ecore.EObject modelElement)
eObject
and its siblings have been removed from
the collection
.
NOTE: Note that you will NOT receive a separate notification for each
sibling.
modelElementRemoved
in interface IdEObjectCollectionChangeObserver
collection
- the IdEObjectCollection
to which the eObject
was addedmodelElement
- the EObject
that has been added to the collection
IdEObjectCollectionChangeObserver.modelElementRemoved(org.eclipse.emf.emfstore.internal.common.model.IdEObjectCollection,
org.eclipse.emf.ecore.EObject)
public void collectionDeleted(IdEObjectCollection collection)
IdEObjectCollection
is deleted.
collectionDeleted
in interface IdEObjectCollectionChangeObserver
collection
- the IdEObjectCollection
that has been deletedIdEObjectCollectionChangeObserver.collectionDeleted(org.eclipse.emf.emfstore.internal.common.model.IdEObjectCollection)
public void startChangeRecording()
public void stopChangeRecording()
public OperationRecorderConfig getRecorderConfig()
public void commandCompleted(org.eclipse.emf.common.command.Command command, boolean isNestedCommand)
command
- the Command
that has been completedisNestedCommand
- whether the completed command is a command inside another one.
If the completed command is nested, the OperationRecorder
's
internal state maintains the state of a command still being runpublic boolean isCommandRunning()
true
if a command is being run, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |