org.pietschy.command.undo
Class UndoableActionCommand
- ActionCommandExecutor, UndoableEventSource
public abstract class UndoableActionCommand
UndoableActionCommands provide a default implementation for commands that can be undone.
UndoableActionCommands implement
UndoableEventSource and can be monitored by an
UndoController
void | addUndoableEditListener(UndoableEditListener l)- Adds a new
javax.swing.event.UndoableEditListener to this command.
|
UndoableEditListener[] | getUndoableEditListeners()- Gets the
javax.swing.event.UndoableEditListeners regstered with this command.
|
protected void | handleExecute()- Delegates to
performEdit() and notifies any UndoableEditListeners of any edit
that performEdit returns.
|
protected abstract UndoableEdit | performEdit()- Called by
handleExecute() to perform the undoable edit.
|
protected void | postEdit(UndoableEdit e)- Notifies all the
javax.swing.event.UndoableEditListeners of the undoable event.
|
void | removeUndoableEditListener(UndoableEditListener l)- Removes an
javax.swing.event.UndoableEditListener from this command.
|
addCommandListener, addInterceptor, areEqual, attach, configureButtonStates, detach, execute, execute, getActionAdapter, getActionAdapter, getActionCommand, getActionEvent, getHint, getHint, getHints, getInvoker, getInvokerWindow, getModifiers, handleExecute, installShortCut, installShortCut, postExecute, preExecute, putHint, putHints, removeCommandListener, removeInterceptor, requestDefautIn, setActionCommand, uninstallShortCut, uninstallShortCut |
addFace, addHoverListener, addNewFace, addNotify, addPropertyChangeListener, addPropertyChangeListener, attach, buttonIterator, configureButtonAppearance, configureButtonAppearances, configureButtonAppearances, configureButtonStates, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, detach, export, faceExists, fireHoverEnded, fireHoverStarted, getAccelerator, getAlternativeFaceNames, getButtonFactory, getButtonIn, getCommandManager, getDefaultFace, getDefaultFace, getDescription, getFace, getFace, getIcon, getId, getLongDescription, getMenuFactory, getMnemonic, getMnemonicIndex, getProperty, getProperty, getPropertyNames, getSelectedIcon, getText, getTextPosition, getToolbarFactory, initCommandManager, installFace, isAnonymous, isAttachedTo, isEnabled, isVisible, putProperty, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setAccelerator, setButtonFactory, setDescription, setEnabled, setIcon, setLongDescription, setMenuFactory, setMnemonic, setMnemonicIndex, setSelectedIcon, setText, setTextPosition, setToolbarFactory, setVisible, toString |
UndoableActionCommand
public UndoableActionCommand()
Creates a new anonymous UndoableActionCommand. Anonymous commands must be fully programatically
generated and can only be added to groups manually by calling
groupCommand.installFace(myAnonymousCommand).
UndoableActionCommand
public UndoableActionCommand(String commandId)
UndoableActionCommand
public UndoableActionCommand(CommandManager manager,
String commandId) Creates a new command with the specified id that is bound to the
specified
CommandManager.
addUndoableEditListener
public void addUndoableEditListener(UndoableEditListener l)
Adds a new javax.swing.event.UndoableEditListener to this command.
- addUndoableEditListener in interface UndoableEventSource
l - the listener to installFace.
getUndoableEditListeners
public UndoableEditListener[] getUndoableEditListeners()
Gets the javax.swing.event.UndoableEditListeners regstered with this command.
- getUndoableEditListeners in interface UndoableEventSource
performEdit
protected abstract UndoableEdit performEdit()
Called by
handleExecute() to perform the undoable edit. This method must return an undoable edit
that can be used by an undo controller to reverse the effects of the command. This method may return
null if nothing was done.
- an UndoableEdit that can be used to undo the effects of the command or null if no action
was taken.
postEdit
protected void postEdit(UndoableEdit e)
Notifies all the javax.swing.event.UndoableEditListeners of the undoable event.
removeUndoableEditListener
public void removeUndoableEditListener(UndoableEditListener l)
Removes an javax.swing.event.UndoableEditListener from this command.
- removeUndoableEditListener in interface UndoableEventSource
l - the listener to remove.