|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.workspace.EMFOperationCommand
public class 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:
RecordingCommands
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.util.ConditionalRedoCommand |
|---|
ConditionalRedoCommand.Compound |
| Constructor Summary | |
|---|---|
EMFOperationCommand(TransactionalEditingDomain domain,
IUndoableOperation operation)
Initializes me with the undoable operation that I wrap. |
|
EMFOperationCommand(TransactionalEditingDomain domain,
IUndoableOperation operation,
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. |
Command |
chain(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,
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,
IUndoableOperation operation,
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()
canExecute in interface Commandpublic void execute()
execute in interface CommandIllegalStateException - if I am being executed outside of a
read/write transaction contextpublic boolean canUndo()
canUndo in interface Commandpublic void undo()
undo in interface CommandIllegalStateException - if I am being undone outside of a
read/write transaction contextpublic boolean canRedo()
canRedo in interface ConditionalRedoCommandtrue if I can be redone; false,
otherwisepublic void redo()
redo in interface CommandIllegalStateException - if I am being redone outside of a
read/write transaction contextpublic Collection getResult()
getResult in interface Commandpublic Collection getAffectedObjects()
IAdvancedUndoableOperation.
getAffectedObjects in interface Commandpublic String getLabel()
getLabel in interface Commandpublic String getDescription()
getDescription in interface Commandpublic void dispose()
dispose in interface Commandpublic Command chain(Command command)
chain in interface Command
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||