org.eclipse.emf.mapping.command
Class PersistentCommandStack
java.lang.Object
|
+--org.eclipse.emf.common.command.BasicCommandStack
|
+--org.eclipse.emf.mapping.command.PersistentCommandStack
- All Implemented Interfaces:
- CommandStack
- public class PersistentCommandStack
- extends BasicCommandStack
This implementation of a command stack records the command class and command parameter used to create each command.
This information can be used to create and execute all the commands again in a different session.
Constructor Summary |
PersistentCommandStack(java.lang.ClassLoader classLoader)
This constructs and instance of a command stack that records commands using a persistent encoding. |
Methods inherited from class org.eclipse.emf.common.command.BasicCommandStack |
addCommandStackListener, canRedo, canUndo, flush, getMostRecentCommand, getRedoCommand, getUndoCommand, isSaveNeeded, notifyListeners, redo, removeCommandStackListener, saveIsDone, undo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
commandCreationMap
protected java.util.HashMap commandCreationMap
- This keeps track of the mapping between commands and their
PersistentCommandStack.CommandCreationRecord
s.
domain
protected MappingDomain domain
classLoader
protected java.lang.ClassLoader classLoader
encoding
protected java.lang.String encoding
PersistentCommandStack
public PersistentCommandStack(java.lang.ClassLoader classLoader)
- This constructs and instance of a command stack that records commands using a persistent encoding.
handleCreateCommand
public void handleCreateCommand(java.lang.Class commandClass,
CommandParameter commandParameter,
Command command)
- This is called by the mapping domain whenever a command (that may subsequently be executed) is created.
createEncoder
protected PersistentCommandStack.Encoder createEncoder()
- You can overide this to create your own type of encoder.
createDecoder
protected PersistentCommandStack.Decoder createDecoder(MappingRoot mappingRoot,
ResourceSet resourceSet,
java.lang.ClassLoader classLoader)
- You can overide this to create your own type of decoder.
execute
public void execute(Command command)
- This override of execute calls
PersistentCommandStack.CommandCreationRecord.encode(org.eclipse.emf.mapping.command.PersistentCommandStack.Encoder)
just before normal execution by super.
- Overrides:
execute
in class BasicCommandStack
- Following copied from interface:
org.eclipse.emf.common.command.CommandStack
- Parameters:
command
- the command to execute.
getEncoding
public java.lang.String getEncoding()
setEncoding
public void setEncoding(MappingDomain domain,
java.lang.String encoding)
executeEncoding
protected void executeEncoding()