|
||||||||||
| 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.AbstractTransactionalCommandStack
org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl
public class WorkspaceCommandStackImpl
Implementation of a transactional command stack that delegates
execution of commands to an IOperationHistory.
This is the command stack implementation used by editing domains created by
the WorkspaceEditingDomainFactory.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack |
|---|
exceptionHandler |
| Fields inherited from class org.eclipse.emf.common.command.BasicCommandStack |
|---|
commandList, listeners, mostRecentCommand, saveIndex, top |
| Constructor Summary | |
|---|---|
WorkspaceCommandStackImpl(IOperationHistory history)
Initializes me with the operation history to which I delegate command execution. |
|
| Method Summary | |
|---|---|
boolean |
canRedo()
Queries whether we can redo my default undo context in my operation history. |
boolean |
canUndo()
Queries whether we can undo my default undo context in my operation history. |
EMFCommandTransaction |
createTransaction(Command command,
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. |
protected void |
doExecute(Command command,
Map<?,?> options)
Implemented by subclasses to perform the execution of the specified command. |
void |
executeTriggers(Command command,
List<Command> triggers,
Map<?,?> options)
Executes the specified list of trigger commands. |
void |
flush()
Disposes my default undo context in my operation history. |
IUndoContext |
getDefaultUndoContext()
Obtains the default undo context to add to the undoable operations that I execute on my operation history to wrap Commands. |
protected String |
getDefaultUndoContextLabel()
Obtains the label to display for the default undo context that I apply to operations executed through me as Commands. |
Command |
getMostRecentCommand()
Gets the command from the most recently executed, done, or redone operation. |
IOperationHistory |
getOperationHistory()
Obtains the operation history to which I delegate command execution. |
Command |
getRedoCommand()
Gets the command from the top of the redo history, if any. |
protected String |
getSavepointUndoContextLabel()
Obtains the label to display for the save-point undo context that I apply to the last operation in my default undo context that was executed at the time save was performed (as indicated by invocation of the saveIsDone() method). |
Command |
getUndoCommand()
Gets the command from the top of the undo history, if any. |
boolean |
isSaveNeeded()
|
void |
redo()
Redoes my default undo context in my operation history. |
void |
saveIsDone()
|
void |
setEditingDomain(InternalTransactionalEditingDomain domain)
Extends the superclass implementation to add/remove listeners on the editing domain. |
void |
undo()
Undoes my default undo context in my operation history. |
| Methods inherited from class org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack |
|---|
basicExecute, execute, execute, getDomain, getExceptionHandler, getUndoRedoOptions, handleError, handleRollback, makeTriggerTransactionOptions, rollback, setExceptionHandler |
| Methods inherited from class org.eclipse.emf.common.command.BasicCommandStack |
|---|
addCommandStackListener, notifyListeners, removeCommandStackListener |
| 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.transaction.TransactionalCommandStack |
|---|
execute, getExceptionHandler, setExceptionHandler |
| Methods inherited from interface org.eclipse.emf.common.command.CommandStack |
|---|
addCommandStackListener, execute, removeCommandStackListener |
| Constructor Detail |
|---|
public WorkspaceCommandStackImpl(IOperationHistory history)
history - my operation history| Method Detail |
|---|
public void setEditingDomain(InternalTransactionalEditingDomain domain)
setEditingDomain in interface InternalTransactionalCommandStacksetEditingDomain in class AbstractTransactionalCommandStackdomain - my editing domainInternalTransactionalCommandStack.createTransaction(Command, Map)public final IOperationHistory getOperationHistory()
IWorkspaceCommandStack
getOperationHistory in interface IWorkspaceCommandStackpublic final IUndoContext getDefaultUndoContext()
IWorkspaceCommandStackCommands. Moreover,
undo, redo, and flush are context-specific operations
in the operation history, so my undo/redo/flush commands use this context
in delegating to the history. Likewise, the determination of the
most recent command and undo/redo commands depends on this context.
getDefaultUndoContext in interface IWorkspaceCommandStackTransactionalCommandStack.execute(Command, java.util.Map),
CommandStack.undo(),
CommandStack.redo(),
CommandStack.flush(),
CommandStack.getMostRecentCommand(),
CommandStack.getUndoCommand(),
CommandStack.getRedoCommand()protected String getDefaultUndoContextLabel()
Commands. Subclasses may
override to customize the label.
protected String getSavepointUndoContextLabel()
saveIsDone() method). Subclasses may override to customize the label.
protected void doExecute(Command command,
Map<?,?> options)
throws InterruptedException,
RollbackException
command. Invoked by the AbstractTransactionalCommandStack.execute(Command, Map)
method.
doExecute in class AbstractTransactionalCommandStackcommand - the command to executeoptions - the transaction options to apply to execution of the command
InterruptedException - if the current thread is interrupted while
waiting to start the transaction
RollbackException - if the execution of the command is rolled backpublic boolean canUndo()
canUndo in interface CommandStackcanUndo in class BasicCommandStackpublic void undo()
undo in interface CommandStackundo in class BasicCommandStackpublic boolean canRedo()
canRedo in interface CommandStackcanRedo in class BasicCommandStackpublic void redo()
redo in interface CommandStackredo in class BasicCommandStackpublic void flush()
flush in interface CommandStackflush in class BasicCommandStackpublic Command getMostRecentCommand()
getMostRecentCommand in interface CommandStackgetMostRecentCommand in class BasicCommandStackpublic Command getUndoCommand()
getUndoCommand in interface CommandStackgetUndoCommand in class BasicCommandStackpublic Command getRedoCommand()
getRedoCommand in interface CommandStackgetRedoCommand in class BasicCommandStack
public EMFCommandTransaction createTransaction(Command command,
Map<?,?> options)
throws InterruptedException
org.eclipse.emf.transaction.impl.InternalTransactionalCommandStack
createTransaction in interface InternalTransactionalCommandStackcommand - a command that I need to executeoptions - the options to apply to the resulting transaction
InterruptedException - if the current thread is interrupted while
waiting for the transaction to startInternalTransactionalCommandStack.getDomain()
public void executeTriggers(Command command,
List<Command> triggers,
Map<?,?> options)
throws InterruptedException,
RollbackException
org.eclipse.emf.transaction.impl.InternalTransactionalCommandStackcommand; they must not be "piggy-backed" on
the currently active transaction.
executeTriggers in interface InternalTransactionalCommandStackcommand - the command whose execution triggered additional commands
(from pre-commit listeners)triggers - a list of zero or more Commands to execute.
If there are none, then no transaction needs to be startedoptions - the options to apply to the child transaction
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()
org.eclipse.emf.transaction.impl.InternalTransactionalCommandStackediting domain
is disposed.
dispose in interface InternalTransactionalCommandStackpublic boolean isSaveNeeded()
isSaveNeeded in class BasicCommandStackpublic void saveIsDone()
saveIsDone in class BasicCommandStack
|
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 | |||||||||