be.ugent.caagt.swirl.undoredo

Class RedoCommand

Implemented Interfaces:
EventListener, UndoListener

public class RedoCommand
extends be.ugent.caagt.swirl.undoredo.UndoRedoCommand

Action command which reverts the last change which was undone by the corresponding undo manager. The undo manager is assumed to be installed as an attribute to the command manager with key UndoManager.class.getName()

Whenever the state of the undo manager changes, caption and description of the 'undoredo' face of the command are changed. Use face inheritance to propagate either the caption or the description to the appropriate menu or toolbar faces, as in the following example:

   
  <command id="redo">
    <class>be.ugent.caagt.swirl.undoredo.RedoCommand</class>
    <face name="undoredo">
       <text>_Redo</text>
       <accelerator keyStroke="ctrl Y"/>
       <description>Redo</description>
    </face>
    <face name="menu" extends="[undoredo]">
       <description/>
    </face>
    <face name="toolbar" extends="[undoredo]">
       <text/>
       <icon type="classpath">...</icon>
    </face>
  </command>
 
The initial text and description of the 'undoredo' face are used whenever the command is disabled.

Important note: work on this part of the Swirl library will be discontinued because unfortunately newer versions of the GUI commands framework will no longer be available as open source. In due course this class will become deprecated and will eventually be removed from the library.

Field Summary

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

undoManager

Constructor Summary

RedoCommand(CommandManager commandManager, String id)
Construct an action command of this type.

Method Summary

protected String
getCaption()
protected void
handleExecute()
void
undoStateChanged()
Called after a change of state in the UndoManager which is listened to, i.e., when undoable changes are added or removed from the list, when the list position is changed and when the marked position changes.

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

getCaption, handleExecute, setEnabled, undoStateChanged

Constructor Details

RedoCommand

public RedoCommand(CommandManager commandManager,
                   String id)
Construct an action command of this type.

Method Details

getCaption

protected String getCaption()
Overrides:
getCaption in interface be.ugent.caagt.swirl.undoredo.UndoRedoCommand

handleExecute

protected void handleExecute()
Overrides:
handleExecute in interface be.ugent.caagt.swirl.undoredo.UndoRedoCommand

undoStateChanged

public void undoStateChanged()
Called after a change of state in the UndoManager which is listened to, i.e., when undoable changes are added or removed from the list, when the list position is changed and when the marked position changes.
Specified by:
undoStateChanged in interface UndoListener
Overrides:
undoStateChanged in interface be.ugent.caagt.swirl.undoredo.UndoRedoCommand