be.ugent.caagt.swirl.undoredo
Class UndoRedoAction
java.lang.Object
javax.swing.AbstractAction
be.ugent.caagt.swirl.actions.SimpleAction
be.ugent.caagt.swirl.undoredo.UndoRedoAction
- All Implemented Interfaces:
- UndoListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
- Direct Known Subclasses:
- RedoAction, UndoAction
public abstract class UndoRedoAction
- extends SimpleAction
- implements UndoListener
Common super class for UndoAction
and RedoAction
- 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 |
protected |
UndoRedoAction(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 with the given parameters |
Method Summary |
protected abstract java.lang.String |
getCaption()
Obtain the correct caption from the manager. |
void |
putValue(java.lang.String key,
java.lang.Object newValue)
Overridden to set the disabled caption
from the first caption set. |
void |
setEnabled(boolean newValue)
Enables/disables the action and changes the caption accordingly. |
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 |
manager
protected final UndoManager manager
UndoRedoAction
protected UndoRedoAction(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 with the given parameters
setEnabled
public void setEnabled(boolean newValue)
- Enables/disables the action and changes the caption accordingly.
- Specified by:
setEnabled
in interface javax.swing.Action
- Overrides:
setEnabled
in class javax.swing.AbstractAction
putValue
public void putValue(java.lang.String key,
java.lang.Object newValue)
- Overridden to set the disabled caption
from the first caption set.
- Specified by:
putValue
in interface javax.swing.Action
- Overrides:
putValue
in class javax.swing.AbstractAction
- Parameters:
key
- newValue
-
getCaption
protected abstract java.lang.String getCaption()
- Obtain the correct caption from the manager.