be.ugent.caagt.swirl.undoredo

Class UndoRedoAction

Implemented Interfaces:
EventListener, UndoListener
Known Direct Subclasses:
RedoAction, UndoAction

public abstract class UndoRedoAction
extends SimpleAction
implements UndoListener

Common super class for UndoAction and RedoAction

Field Summary

protected UndoManager
manager

Fields inherited from class be.ugent.caagt.swirl.actions.SimpleAction

MEDIUM_DISABLED_ICON, MEDIUM_ICON, SMALL_DISABLED_ICON, TOGGLE_BUTTON_MODEL

Constructor Summary

UndoRedoAction(UndoManager manager, ResourceBundle bundle, String key, Icon icon, Icon mediumIcon, Icon mediumDisabledIcon)
Create an action of this type with the given parameters

Method Summary

protected abstract String
getCaption()
Obtain the correct caption from the manager.
@Override
void putValue(String key, Object newValue)
Overridden to set the disabled caption from the first caption set.
@Override
void setEnabled(boolean newValue)
Enables/disables the action and changes the caption accordingly.

Methods inherited from class be.ugent.caagt.swirl.actions.SimpleAction

actionPerformed, setMediumDisabledIcon, setMediumIcon, setSharedToggleButtonModel, setSmallDisabledIcon

Field Details

manager

protected final UndoManager manager

Constructor Details

UndoRedoAction

protected UndoRedoAction(UndoManager manager,
                         ResourceBundle bundle,
                         String key,
                         Icon icon,
                         Icon mediumIcon,
                         Icon mediumDisabledIcon)
Create an action of this type with the given parameters

Method Details

getCaption

protected abstract String getCaption()
Obtain the correct caption from the manager.

void putValue

public @Override void putValue(String key,
                               Object newValue)
Overridden to set the disabled caption from the first caption set.
Parameters:
key -
newValue -

void setEnabled

public @Override void setEnabled(boolean newValue)
Enables/disables the action and changes the caption accordingly.