be.ugent.caagt.swirl.undoredo

Class RedoAction

Implemented Interfaces:
EventListener, UndoListener

public class RedoAction
extends UndoRedoAction

Action which reverts the last undo effected by 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.

Field Summary

Fields inherited from class be.ugent.caagt.swirl.undoredo.UndoRedoAction

manager

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

MEDIUM_DISABLED_ICON, MEDIUM_ICON, SMALL_DISABLED_ICON, TOGGLE_BUTTON_MODEL

Constructor Summary

RedoAction(UndoManager manager)
Create an action of this type for use with the MenuBuilder.
RedoAction(UndoManager manager, ResourceBundle bundle, String key, Icon icon, Icon mediumIcon, Icon mediumDisabledIcon)
Create an action of this type.

Method Summary

protected @Override
String getCaption()
void
actionPerformed(ActionEvent e)
Redoes the current undoable change.
void
undoStateChanged()
Enables or disables the button according to whether any changes remain to be redone or not.

Methods inherited from class be.ugent.caagt.swirl.undoredo.UndoRedoAction

getCaption, void putValue, void setEnabled

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

actionPerformed, setMediumDisabledIcon, setMediumIcon, setSharedToggleButtonModel, setSmallDisabledIcon

Constructor Details

RedoAction

public RedoAction(UndoManager manager)
Create an action of this type for use with the MenuBuilder.

RedoAction

public RedoAction(UndoManager manager,
                  ResourceBundle bundle,
                  String key,
                  Icon icon,
                  Icon mediumIcon,
                  Icon mediumDisabledIcon)
Create an action of this type. When the action is enabled, 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 applies
bundle - 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)

Method Details

String getCaption

protected @Override String getCaption()

actionPerformed

public void actionPerformed(ActionEvent e)
Redoes the current undoable change.
Overrides:
actionPerformed in interface SimpleAction

undoStateChanged

public void undoStateChanged()
Enables or disables the button according to whether any changes remain to be redone or not.
Specified by:
undoStateChanged in interface UndoListener