Class AbstractUndoRedoAction

All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
ActionRedo, ActionUndo

public abstract class AbstractUndoRedoAction extends AbstractJmodelAction
An abstract class grouping functionalities common to Undo and Redo action. These kind of action are a bit tricky because we want their displayed name to contain a description of the edit that will be redone. A way to do this is maintaining a list of all created instances and scanning through it at every update.
That said, the main function of this class is to provide a means to update the state of all Undo/redo actions through its static method updateAll()
See Also:
  • Field Details

  • Constructor Details

    • AbstractUndoRedoAction

      public AbstractUndoRedoAction(String name, Mediator mediator)
  • Method Details

    • update

      public abstract void update()
      Update the state (name & enabled) of this instance. To be overridden in subclasses
    • updateAll

      public static void updateAll()
      Update the state (name & enabled) of all instances
    • dispose

      public void dispose()
      Removes this action from the update list. Should be called before deleting all references to an ActionRedo