|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.operations.AbstractOperation
org.eclipse.emf.workspace.AbstractEMFOperation
org.eclipse.emf.workspace.EMFCommandOperation
public class EMFCommandOperation
An operation that wraps an EMF Command to execute it in a read/write
transaction on an IOperationHistory. This class may be created
explicitly by a client of the operation history, or it may be used implicitly
by executing a command on the TransactionalCommandStack.
| Constructor Summary | |
|---|---|
EMFCommandOperation(TransactionalEditingDomain domain,
org.eclipse.emf.common.command.Command command)
Initializes me with my editing domain and a command to execute. |
|
EMFCommandOperation(TransactionalEditingDomain domain,
org.eclipse.emf.common.command.Command command,
Map<?,?> options)
Initializes me with my editing domain, a command to execute, and transaction options. |
|
| Method Summary | |
|---|---|
boolean |
canExecute()
I can execute if my command can execute. |
boolean |
canRedo()
I can redo if either my wrapped command is a ConditionalRedoCommand
that can undo, or it is not a conditionally redoable command. |
boolean |
canUndo()
I can undo if my command or (if any) trigger command can undo. |
protected void |
didCommit(Transaction transaction)
Hook for subclasses to learn that the specified transaction
has been successfully committed and, if necessary, to extract information
from it. |
void |
dispose()
Extends the inherited implementation to additionally dispose my command and my trigger command (if any). |
protected IStatus |
doExecute(IProgressMonitor monitor,
IAdaptable info)
Executes me by executing my command. |
protected IStatus |
doRedo(IProgressMonitor monitor,
IAdaptable info)
Redoes me by redoing my command and my trigger command (if any). |
protected IStatus |
doUndo(IProgressMonitor monitor,
IAdaptable info)
Undoes me by undoing my trigger command (if any) and my command. |
org.eclipse.emf.common.command.Command |
getCommand()
Obtains the command that I wrap. |
protected void |
improveLabel(org.eclipse.emf.common.command.Command cmd)
Computes a more user-friendly label for the operation than the label created by default for EMF's feature-changing commands. |
| Methods inherited from class org.eclipse.emf.workspace.AbstractEMFOperation |
|---|
aggregateStatuses, canSetOptions, didRedo, didUndo, execute, getChange, getEditingDomain, getOptions, isReuseParentTransaction, redo, setOptions, setReuseParentTransaction, undo |
| Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation |
|---|
addContext, getContexts, getLabel, hasContext, removeContext, setLabel, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EMFCommandOperation(TransactionalEditingDomain domain,
org.eclipse.emf.common.command.Command command)
domain - my domaincommand - my command
public EMFCommandOperation(TransactionalEditingDomain domain,
org.eclipse.emf.common.command.Command command,
Map<?,?> options)
domain - my domaincommand - my commandoptions - transaction options, or null for the defaults| Method Detail |
|---|
public final org.eclipse.emf.common.command.Command getCommand()
public boolean canExecute()
canExecute in interface IUndoableOperationcanExecute in class AbstractOperation
protected IStatus doExecute(IProgressMonitor monitor,
IAdaptable info)
throws ExecutionException
doExecute in class AbstractEMFOperationmonitor - the progress monitor provided by the operation history.
Will never be null because the
AbstractEMFOperation.execute(IProgressMonitor, IAdaptable) method would substitute
a NullProgressMonitor in that caseinfo - the adaptable provided by the operation history
ExecutionException - if, for some reason, I fail to complete
the operationprotected void didCommit(Transaction transaction)
AbstractEMFOperation
Hook for subclasses to learn that the specified transaction
has been successfully committed and, if necessary, to extract information
from it.
Note: subclasses should call this super implementation to get some default behaviours.
didCommit in class AbstractEMFOperationtransaction - a transaction that has committed, which has recorded
our changespublic boolean canUndo()
canUndo in interface IUndoableOperationcanUndo in class AbstractEMFOperation
protected IStatus doUndo(IProgressMonitor monitor,
IAdaptable info)
throws ExecutionException
doUndo in class AbstractEMFOperationmonitor - the progress monitor provided by the operation history
Will never be null because the
AbstractEMFOperation.undo(IProgressMonitor, IAdaptable) method would substitute
a NullProgressMonitor in that caseinfo - the adaptable provided by the operation history
ExecutionException - on failure to undopublic boolean canRedo()
ConditionalRedoCommand
that can undo, or it is not a conditionally redoable command.
canRedo in interface IUndoableOperationcanRedo in class AbstractEMFOperation
protected IStatus doRedo(IProgressMonitor monitor,
IAdaptable info)
throws ExecutionException
doRedo in class AbstractEMFOperationmonitor - the progress monitor provided by the operation history
Will never be null because the
AbstractEMFOperation.redo(IProgressMonitor, IAdaptable) method would substitute
a NullProgressMonitor in that caseinfo - the adaptable provided by the operation history
ExecutionException - on failure to redopublic void dispose()
dispose in interface IUndoableOperationdispose in class AbstractEMFOperationprotected void improveLabel(org.eclipse.emf.common.command.Command cmd)
cmd - a 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 | |||||||||