be.ugent.caagt.swirl.undoredo

Class RedoAction

Implemented Interfaces:
EventListener, UndoListener

public class RedoAction
extends SimpleAction
implements UndoListener

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.actions.SimpleAction

MEDIUM_DISABLED_ICON, MEDIUM_ICON

Constructor Summary

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

Method Summary

void
actionPerformed(ActionEvent e)
Redoes the current undoable change.
void
setEnabled(boolean newValue)
Enables/disables the action and changes the caption accordingly.
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.actions.SimpleAction

actionPerformed

Constructor Details

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

actionPerformed

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

setEnabled

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

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