be.ugent.caagt.swirl.undoredo
Class UndoAction
java.lang.Object
javax.swing.AbstractAction
be.ugent.caagt.swirl.actions.SimpleAction
be.ugent.caagt.swirl.undoredo.UndoRedoAction
be.ugent.caagt.swirl.undoredo.UndoAction
- All Implemented Interfaces:
- UndoListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class UndoAction
- extends UndoRedoAction
Action which undoes the last change registered with the corresponding
undo manager. When the action is enabled, the
caption is taken from the current UndoableChange
in the undo list of the associated UndoManager
.
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary |
UndoAction(UndoManager manager)
Create an action of this type for use with the MenuBuilder . |
UndoAction(UndoManager manager,
java.util.ResourceBundle bundle,
java.lang.String key,
javax.swing.Icon icon,
javax.swing.Icon mediumIcon,
javax.swing.Icon mediumDisabledIcon)
Create an action of this type. |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
Undoes the current undoable change. |
protected java.lang.String |
getCaption()
Obtain the correct caption from the manager. |
void |
undoStateChanged()
Enables or disables the button according to whether
any changes remain to be undone or not. |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UndoAction
public UndoAction(UndoManager manager,
java.util.ResourceBundle bundle,
java.lang.String key,
javax.swing.Icon icon,
javax.swing.Icon mediumIcon,
javax.swing.Icon mediumDisabledIcon)
- Create an action of this type. When the action is enabled, the
the caption is taken from the current
UndoableChange
of the
associated UndoManager
. Mnemonic
and accelerator key are taken from the description object as defined
by the parameters bundle
and key
.
- Parameters:
manager
- Undo manager to which this action appliesbundle
- Resource bundle which contains the description for
this action.key
- Key used for the description of this action in the bundle.icon
- Small icon to be used for menu and standard button decoration (or null)mediumIcon
- Medium size icon to be used for tool bar buttons (or null)mediumDisabledIcon
- Medium size icon to be used for a disabled tool bar buttons (or null)
UndoAction
public UndoAction(UndoManager manager)
- Create an action of this type for use with the
MenuBuilder
.
getCaption
protected java.lang.String getCaption()
- Description copied from class:
UndoRedoAction
- Obtain the correct caption from the manager.
- Specified by:
getCaption
in class UndoRedoAction
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Undoes the current undoable change.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Specified by:
actionPerformed
in class SimpleAction
undoStateChanged
public void undoStateChanged()
- Enables or disables the button according to whether
any changes remain to be undone or not.