KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > actions > SaveAs


1 /*
2  * Authors:
3  * Stefanovic Nenad chupo@iis.ns.ac.yu
4  * Bojanic Sasa sasaboy@neobee.net
5  * Puskas Vladimir vpuskas@eunet.yu
6  * Pilipovic Goran zboniek@uns.ac.yu
7  *
8  */

9
10 package org.enhydra.jawe.actions;
11
12 import org.enhydra.jawe.*;
13 import java.awt.event.ActionEvent JavaDoc;
14
15 /**
16  * Class that realizes <B>save as</B> action.
17  */

18 public class SaveAs extends Save {
19
20    public SaveAs (PackageEditor editor) {
21       super(editor,"SaveAs");
22    }
23
24    public void actionPerformed(ActionEvent JavaDoc e) {
25       PackageEditor pe=JaWE.getInstance().getPackageEditor();
26       if (!pe.isInitialized()) {
27          pe.enterPackageID();
28       }
29       String JavaDoc oldFilename=JaWE.getInstance().getFilename();
30       JaWE.getInstance().setFilename(null);
31       super.actionPerformed(e);
32       if (JaWE.getInstance().getFilename()==null) {
33          JaWE.getInstance().setFilename(oldFilename);
34       }
35       pe.update();
36    }
37 }
38
Popular Tags