net.sf.rej.gui.action
Class GroupAction

java.lang.Object
  extended by net.sf.rej.gui.action.GroupAction
All Implemented Interfaces:
Undoable

public class GroupAction
extends java.lang.Object
implements Undoable

Utility class to group to Undoable objects together. This GroupAction can then be added into the Undo stack, causing the two or more grouped actions to always execute/get undone at the same time. A group of Undoable objects A, B and C will always be executed in the order:
A
B
C

And always undone in the order:
C
B
A

Author:
Sami Koivu

Constructor Summary
GroupAction()
           
 
Method Summary
 void add(Undoable action)
           
 void execute()
          Execute the command/action that fulfills the Undoable contract.
 boolean isEmpty()
           
 void undo()
          Undo all the changes caused by a call to the execute() method of this instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupAction

public GroupAction()
Method Detail

add

public void add(Undoable action)

execute

public void execute()
Description copied from interface: Undoable
Execute the command/action that fulfills the Undoable contract.

Specified by:
execute in interface Undoable

undo

public void undo()
Description copied from interface: Undoable
Undo all the changes caused by a call to the execute() method of this instance.

Specified by:
undo in interface Undoable

isEmpty

public boolean isEmpty()