|
||||||||||||
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
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,
java.util.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.
|
protected org.eclipse.core.runtime.IStatus |
doExecute(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info)
Executes me by executing my command. |
protected org.eclipse.core.runtime.IStatus |
doRedo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info)
Redoes me by redoing my command and my trigger command (if any). |
protected org.eclipse.core.runtime.IStatus |
doUndo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.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, didRedo, didUndo, dispose, execute, getChange, getEditingDomain, getOptions, redo, 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 commandpublic EMFCommandOperation(TransactionalEditingDomain domain, org.eclipse.emf.common.command.Command command, java.util.Map options)
domain
- my domaincommand
- my commandMethod Detail |
public final org.eclipse.emf.common.command.Command getCommand()
public boolean canExecute()
protected org.eclipse.core.runtime.IStatus doExecute(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
doExecute
in class AbstractEMFOperation
monitor
- the progress monitor provided by the operation historyinfo
- the adaptable provided by the operation history
org.eclipse.core.commands.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 AbstractEMFOperation
transaction
- a transaction that has committed, which has recorded
our changespublic boolean canUndo()
canUndo
in interface org.eclipse.core.commands.operations.IUndoableOperation
canUndo
in class AbstractEMFOperation
protected org.eclipse.core.runtime.IStatus doUndo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
doUndo
in class AbstractEMFOperation
monitor
- the progress monitor provided by the operation historyinfo
- the adaptable provided by the operation history
org.eclipse.core.commands.ExecutionException
- on failure to undopublic boolean canRedo()
ConditionalRedoCommand
that can undo, or it is not a conditionally redoable command.
canRedo
in interface org.eclipse.core.commands.operations.IUndoableOperation
canRedo
in class AbstractEMFOperation
protected org.eclipse.core.runtime.IStatus doRedo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
doRedo
in class AbstractEMFOperation
monitor
- the progress monitor provided by the operation historyinfo
- the adaptable provided by the operation history
org.eclipse.core.commands.ExecutionException
- on failure to redoprotected void improveLabel(org.eclipse.emf.common.command.Command cmd)
cmd
- a 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 |