|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.workspace.EMFOperationCommand
An implementation of the EMF Command
API that wraps an
IUndoableOperation
. It is particularly useful for returning triggers
from a ResourceSetListener
that perform non-EMF changes. An
EMFOperationCommand
, when executed, automatically inserts itself
into the change description of the active transaction to support the
inclusion of these non-EMF changes in:
RecordingCommand
s
Constructor Summary | |
EMFOperationCommand(TransactionalEditingDomain domain,
org.eclipse.core.commands.operations.IUndoableOperation operation)
Initializes me with the undoable operation that I wrap. |
|
EMFOperationCommand(TransactionalEditingDomain domain,
org.eclipse.core.commands.operations.IUndoableOperation operation,
org.eclipse.core.runtime.IAdaptable adaptable)
Initializes me with the undoable operation that I wrap and an adaptable to pass to it when I execute/undo/redo. |
Method Summary | |
boolean |
canExecute()
I can execute if my wrapped operation can execute. |
boolean |
canRedo()
I can redo if my wrapped operation can redo. |
boolean |
canUndo()
I can undo if my wrapped operation can undo. |
org.eclipse.emf.common.command.Command |
chain(org.eclipse.emf.common.command.Command command)
|
void |
dispose()
Forgets my operation and the adaptable with which I was initialized, if any. |
void |
execute()
Executes my wrapped operation and inserts it into the active transaction's change description for rollback and undo/redo support. |
Collection |
getAffectedObjects()
Obtains the affected objects from my wrapped operation, if it is an IAdvancedUndoableOperation . |
String |
getDescription()
My description is my wrapped operation's label. |
String |
getLabel()
My label is my wrapped operation's label. |
Collection |
getResult()
|
void |
redo()
I redo my wrapped operation. |
void |
undo()
I undo my wrapped operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EMFOperationCommand(TransactionalEditingDomain domain, org.eclipse.core.commands.operations.IUndoableOperation operation)
domain
- the editing domain in which I will be executedoperation
- my operation
IllegalArgumentException
- if either the domain or operation is
null
public EMFOperationCommand(TransactionalEditingDomain domain, org.eclipse.core.commands.operations.IUndoableOperation operation, org.eclipse.core.runtime.IAdaptable adaptable)
domain
- the editing domain in which I will be executedoperation
- my operationadaptable
- the adaptable to provide UI context to the operation
IllegalArgumentException
- if either the domain or operation is
null
Method Detail |
public boolean canExecute()
public void execute()
IllegalStateException
- if I am being executed outside of a
read/write transaction contextpublic boolean canUndo()
public void undo()
IllegalStateException
- if I am being undone outside of a
read/write transaction contextpublic boolean canRedo()
public void redo()
IllegalStateException
- if I am being redone outside of a
read/write transaction contextpublic Collection getResult()
public Collection getAffectedObjects()
IAdvancedUndoableOperation
.
public String getLabel()
public String getDescription()
public void dispose()
public org.eclipse.emf.common.command.Command chain(org.eclipse.emf.common.command.Command command)
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |