home *** CD-ROM | disk | FTP | other *** search
- import com.sun.java.swing.AbstractAction;
- import com.sun.java.swing.undo.CannotUndoException;
- import java.awt.event.ActionEvent;
-
- class Notepad$UndoAction extends AbstractAction {
- // $FF: synthetic field
- private final Notepad this$0;
-
- public Notepad$UndoAction(Notepad var1) {
- super("Undo");
- this.this$0 = var1;
- this.this$0 = var1;
- ((AbstractAction)this).setEnabled(false);
- }
-
- public void actionPerformed(ActionEvent var1) {
- try {
- this.this$0.undo.undo();
- } catch (CannotUndoException var3) {
- System.out.println("Unable to undo: " + var3);
- ((Throwable)var3).printStackTrace();
- }
-
- this.update();
- Notepad.access$0(this.this$0).update();
- }
-
- protected void update() {
- if (this.this$0.undo.canUndo()) {
- ((AbstractAction)this).setEnabled(true);
- ((AbstractAction)this).putValue("Name", this.this$0.undo.getUndoPresentationName());
- } else {
- ((AbstractAction)this).setEnabled(false);
- ((AbstractAction)this).putValue("Name", "Undo");
- }
- }
- }
-