home *** CD-ROM | disk | FTP | other *** search
/ Australian PC Authority 1999 May / may1999.iso / May / JBUILDER / JSAMPLES.Z / Notepad$NewAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-30  |  1.4 KB  |  33 lines

  1. import com.sun.java.swing.AbstractAction;
  2. import com.sun.java.swing.text.Document;
  3. import com.sun.java.swing.text.PlainDocument;
  4. import java.awt.event.ActionEvent;
  5.  
  6. class Notepad$NewAction extends AbstractAction {
  7.    // $FF: synthetic field
  8.    private final Notepad this$0;
  9.  
  10.    Notepad$NewAction(Notepad var1) {
  11.       super("new");
  12.       this.this$0 = var1;
  13.       this.this$0 = var1;
  14.    }
  15.  
  16.    Notepad$NewAction(Notepad var1, String var2) {
  17.       super(var2);
  18.       this.this$0 = var1;
  19.       this.this$0 = var1;
  20.    }
  21.  
  22.    public void actionPerformed(ActionEvent var1) {
  23.       Document var2 = this.this$0.getEditor().getDocument();
  24.       if (var2 != null) {
  25.          var2.removeUndoableEditListener(this.this$0);
  26.       }
  27.  
  28.       this.this$0.getEditor().setDocument(new PlainDocument());
  29.       this.this$0.getEditor().getDocument().addUndoableEditListener(this.this$0);
  30.       this.this$0.revalidate();
  31.    }
  32. }
  33.