|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.command.BasicCommandStack
org.eclipse.emf.transaction.impl.TransactionalCommandStackImpl
The default implementation of the transactional editing domain command stack.
Field Summary |
---|
Fields inherited from class org.eclipse.emf.common.command.BasicCommandStack |
---|
commandList, listeners, mostRecentCommand, saveIndex, top |
Constructor Summary | |
---|---|
TransactionalCommandStackImpl()
Initializes me. |
Method Summary | |
---|---|
boolean |
canRedo()
Extends the inherited implementation to consider the redoability of ConditionalRedoCommand s. |
EMFCommandTransaction |
createTransaction(org.eclipse.emf.common.command.Command command,
java.util.Map options)
Creates a read/write transaction in my editing domain for the purpose of executing the specified command. |
void |
dispose()
Disposes of my state and any additional resources that I may be retaining. |
void |
execute(org.eclipse.emf.common.command.Command command)
Redefines the inherited method by forwarding to the TransactionalEditingDomain#execute(Command, Map) method. |
void |
execute(org.eclipse.emf.common.command.Command command,
java.util.Map options)
Executes the specified command in a read/write transaction. |
void |
executeTriggers(org.eclipse.emf.common.command.Command command,
java.util.List triggers,
java.util.Map options)
Executes the specified list of trigger commands. |
InternalTransactionalEditingDomain |
getDomain()
Obtains the editing domain in which I create transactions. |
ExceptionHandler |
getExceptionHandler()
Obtains my exception handler. |
protected void |
handleError(java.lang.Exception exception)
Extends the inherited method by first rolling back the active transaction (if any) and passing the exception along to the registered exception handler (if any). |
void |
redo()
Extends the inherited implementation by invoking it within the context of a redo transaction (a read/write transaction with the undo/redo options ). |
void |
setEditingDomain(InternalTransactionalEditingDomain domain)
Assigns the editing domain in which I create transactions. |
void |
setExceptionHandler(ExceptionHandler handler)
Sets an exception handler. |
void |
undo()
Extends the inherited implementation by invoking it within the context of an undo transaction (a read/write transaction with the undo/redo options ). |
Methods inherited from class org.eclipse.emf.common.command.BasicCommandStack |
---|
addCommandStackListener, canUndo, flush, getMostRecentCommand, getRedoCommand, getUndoCommand, isSaveNeeded, notifyListeners, removeCommandStackListener, saveIsDone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.common.command.CommandStack |
---|
addCommandStackListener, canUndo, flush, getMostRecentCommand, getRedoCommand, getUndoCommand, removeCommandStackListener |
Constructor Detail |
public TransactionalCommandStackImpl()
Method Detail |
public InternalTransactionalEditingDomain getDomain()
InternalTransactionalCommandStack
getDomain
in interface InternalTransactionalCommandStack
InternalTransactionalCommandStack.createTransaction(Command, Map)
public void setEditingDomain(InternalTransactionalEditingDomain domain)
InternalTransactionalCommandStack
setEditingDomain
in interface InternalTransactionalCommandStack
domain
- my editing domainInternalTransactionalCommandStack.createTransaction(Command, Map)
public void execute(org.eclipse.emf.common.command.Command command, java.util.Map options) throws java.lang.InterruptedException, RollbackException
TransactionalCommandStack
CommandStack.execute(Command)
method because it provides
feed-back when a command fails to complete. The implementation of this
latter method simply suppresses (but logs) any checked exception that
occurs.
Note that this method will block the caller until a read/write transaction can be started (if other transactions are currently active).
execute
in interface TransactionalCommandStack
command
- the command to executeoptions
- the options to apply to the command's transaction, or
null
to select the defaults
java.lang.InterruptedException
- if the current thread is interrupted while
waiting to start a read/write transaction for the command execution
RollbackException
- if the changes performed by the command are
rolled back by validation of the transactionpublic void setExceptionHandler(ExceptionHandler handler)
TransactionalCommandStack
setExceptionHandler
in interface TransactionalCommandStack
handler
- the exception handler to setpublic ExceptionHandler getExceptionHandler()
TransactionalCommandStack
getExceptionHandler
in interface TransactionalCommandStack
null
if noneTransactionalCommandStack.setExceptionHandler(ExceptionHandler)
protected void handleError(java.lang.Exception exception)
public void execute(org.eclipse.emf.common.command.Command command)
TransactionalEditingDomain#execute(Command, Map)
method. Any checked
exception thrown by that method is handled by
TransactionalCommandStackImpl.handleError(Exception)
but is not propagated.
execute
in interface org.eclipse.emf.common.command.CommandStack
public void undo()
undo/redo options
).
undo
in interface org.eclipse.emf.common.command.CommandStack
public boolean canRedo()
ConditionalRedoCommand
s.
canRedo
in interface org.eclipse.emf.common.command.CommandStack
public void redo()
undo/redo options
).
redo
in interface org.eclipse.emf.common.command.CommandStack
public EMFCommandTransaction createTransaction(org.eclipse.emf.common.command.Command command, java.util.Map options) throws java.lang.InterruptedException
InternalTransactionalCommandStack
createTransaction
in interface InternalTransactionalCommandStack
command
- a command that I need to executeoptions
- the options to apply to the resulting transaction
java.lang.InterruptedException
- if the current thread is interrupted while
waiting for the transaction to startInternalTransactionalCommandStack.getDomain()
public void executeTriggers(org.eclipse.emf.common.command.Command command, java.util.List triggers, java.util.Map options) throws java.lang.InterruptedException, RollbackException
InternalTransactionalCommandStack
command
; they must not be "piggy-backed" on
the currently active transaction.
executeTriggers
in interface InternalTransactionalCommandStack
command
- the command whose execution triggered additional commands
(from pre-commit listeners)triggers
- a list of zero or more Command
s to execute.
If there are none, then no transaction needs to be startedoptions
- the options to apply to the child transaction
java.lang.InterruptedException
- if the current thread is interrupted while
waiting for the trigger transaction to start
RollbackException
- if the trigger transaction rolls back on commitResourceSetListener.transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent)
,
InternalTransactionalCommandStack.createTransaction(Command, Map)
public void dispose()
InternalTransactionalCommandStack
editing domain
is disposed.
dispose
in interface InternalTransactionalCommandStack
|
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 |