01: package org.enhydra.jawe.base.controller.actions.defaultactions;
02:
03: import java.awt.event.ActionEvent;
04:
05: import org.enhydra.jawe.ActionBase;
06: import org.enhydra.jawe.JaWEComponent;
07: import org.enhydra.jawe.UndoHistoryManager;
08: import org.enhydra.jawe.base.controller.JaWEController;
09:
10: /**
11: * Performs undo action.
12: * @author Sasa Bojanic
13: */
14: public class Undo extends ActionBase {
15:
16: public Undo(JaWEComponent jawecomponent) {
17: super (jawecomponent);
18: }
19:
20: public void enableDisableAction() {
21: UndoHistoryManager uhm = ((JaWEController) jawecomponent)
22: .getUndoHistoryManager();
23: setEnabled(uhm != null && uhm.canUndo());
24: }
25:
26: public void actionPerformed(ActionEvent e) {
27: ((JaWEController) jawecomponent).undo();
28: }
29: }
|