KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.awt.event.ActionEvent JavaDoc;
13 import javax.swing.JOptionPane JavaDoc;
14 import org.enhydra.jawe.JaWE;
15 import org.enhydra.jawe.PackageEditor;
16 import org.enhydra.jawe.ResourceManager;
17
18 /**
19  * Class that realizes <B>open</B> action.
20  */

21 public class Reopen extends ActionBase {
22
23    public Reopen (PackageEditor editor) {
24       super(editor);
25    }
26
27    public void actionPerformed(ActionEvent JavaDoc e) {
28       String JavaDoc name = JaWE.getInstance().getFilename();
29       if (name==null) {
30          String JavaDoc msg=ResourceManager.getLanguageDependentString("WarningCannotReopenXPDL");
31          JaWE.getInstance().message(msg,JOptionPane.WARNING_MESSAGE);
32          return;
33       }
34       if (JaWE.getInstance().close()) {
35          JaWE.getInstance().checkNameAndOpenDocumentIfPossible(name);
36       }
37    }
38
39 }
40
Popular Tags