home *** CD-ROM | disk | FTP | other *** search
- import com.sun.java.swing.text.Document;
- import com.sun.java.swing.text.PlainDocument;
- import java.awt.FileDialog;
- import java.awt.Frame;
- import java.awt.event.ActionEvent;
- import java.io.File;
-
- class Notepad$OpenAction extends Notepad$NewAction {
- // $FF: synthetic field
- private final Notepad this$0;
-
- Notepad$OpenAction(Notepad var1) {
- super(var1, "open");
- this.this$0 = var1;
- this.this$0 = var1;
- }
-
- public void actionPerformed(ActionEvent var1) {
- Frame var2 = this.this$0.getFrame();
- if (this.this$0.fileDialog == null) {
- this.this$0.fileDialog = new FileDialog(var2);
- }
-
- this.this$0.fileDialog.setMode(0);
- this.this$0.fileDialog.show();
- String var3 = this.this$0.fileDialog.getFile();
- if (var3 != null) {
- String var4 = this.this$0.fileDialog.getDirectory();
- File var5 = new File(var4, var3);
- if (var5.exists()) {
- Document var6 = this.this$0.getEditor().getDocument();
- if (var6 != null) {
- var6.removeUndoableEditListener(this.this$0);
- }
-
- this.this$0.getEditor().setDocument(new PlainDocument());
- var2.setTitle(var3);
- Notepad$FileLoader var7 = new Notepad$FileLoader(this.this$0, var5, Notepad.access$2(this.this$0).getDocument());
- ((Thread)var7).start();
- }
-
- }
- }
- }
-