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

  1. import com.sun.java.swing.AbstractAction;
  2. import com.sun.java.swing.text.DefaultStyledDocument;
  3. import java.awt.event.ActionEvent;
  4.  
  5. class Stylepad$NewAction extends AbstractAction {
  6.    // $FF: synthetic field
  7.    private final Stylepad this$0;
  8.  
  9.    Stylepad$NewAction(Stylepad var1) {
  10.       super("new");
  11.       this.this$0 = var1;
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void actionPerformed(ActionEvent var1) {
  16.       if (this.this$0.getEditor().getDocument() != null) {
  17.          this.this$0.getEditor().getDocument().removeUndoableEditListener(this.this$0);
  18.       }
  19.  
  20.       this.this$0.getEditor().setDocument(new DefaultStyledDocument());
  21.       this.this$0.getEditor().getDocument().addUndoableEditListener(this.this$0);
  22.       this.this$0.validate();
  23.    }
  24. }
  25.