|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.Command
com.pietschy.command.ActionCommand
com.pietschy.command.undo.AbstractUndoCommand
public abstract class AbstractUndoCommand
Base implementation for UndoCommand and RedoCommand.
This implementation takes care of monitoring the parent CommandContainer and tracking the
UndoContext. Subclasses must implement updateState() and ActionCommand.handleExecute().
| Field Summary |
|---|
| Fields inherited from class com.pietschy.command.ActionCommand |
|---|
PARAMETER_ACTION_EVENT, PARAMETER_INVOKER, PARAMETER_INVOKER_WINDOW, PARAMETER_MODIFIERS |
| Fields inherited from class com.pietschy.command.Command |
|---|
internalLog, PROPERTY_ENABLED, PROPERTY_VISIBLE |
| Constructor Summary | |
|---|---|
AbstractUndoCommand()
Creates a new anonymous instance. |
|
AbstractUndoCommand(java.lang.String id)
Creates a new instance with the specified id. |
|
| Method Summary | |
|---|---|
protected void |
bindToContainer(CommandContainer container)
Binds to the specified command container and updates the undo context. |
protected void |
containerStateChanged()
Updates the current UndoContext whenever a change is detected
in the current CommandContainer heirarchy. |
UndoContext |
getUndoContext()
Gets the current UndoContext. |
void |
setUndoContext(UndoContext newContext)
Sets the current UndoContext. |
protected void |
unbindFromContainer(CommandContainer container)
Unbinds from the specified container and updates the undo context. |
protected abstract void |
updateState()
Must be implemented by subsclasses to update this state based on the return value from getUndoContext(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.pietschy.command.ActionCommandExecutor |
|---|
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.pietschy.command.Identifiable |
|---|
getId |
| Constructor Detail |
|---|
public AbstractUndoCommand()
public AbstractUndoCommand(java.lang.String id)
id - the command id.| Method Detail |
|---|
protected void bindToContainer(CommandContainer container)
bindToContainer in class ActionCommandcontainer - the container to bind to.ActionCommand.unbindFromContainer(CommandContainer)protected void unbindFromContainer(CommandContainer container)
unbindFromContainer in class ActionCommandcontainer - the container to unbind from.ActionCommand.bindToContainer(CommandContainer)public UndoContext getUndoContext()
UndoContext. May return null.
UndoContext or null if there is no undo context.public void setUndoContext(UndoContext newContext)
UndoContext. This is typically updated automatically based on
the current binding.
newContext - the new UndoContext.protected void containerStateChanged()
UndoContext whenever a change is detected
in the current CommandContainer heirarchy.
protected abstract void updateState()
getUndoContext().
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||