KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.elements.*;
15 import org.enhydra.jawe.xml.panels.*;
16
17 import java.awt.event.ActionEvent JavaDoc;
18
19 /**
20 * Class that realizes <B>Hide window</B> action.
21 */

22 public class HideWindow extends ActionBase {
23
24    public HideWindow (ProcessEditor pe) {
25       super(pe);
26    }
27
28    public void actionPerformed(ActionEvent JavaDoc e) {
29       XMLElementDialog elementEditingDialog=
30             ((ProcessEditor)editor).getElementEditingDialog();
31       if (elementEditingDialog!=null && elementEditingDialog.isShowing()) {
32          if (elementEditingDialog.canApplyChanges()) {
33             elementEditingDialog.applyChanges();
34          } else {
35             return;
36          }
37       }
38       elementEditingDialog=null;
39       editor.getWindow().hide();
40
41       // update parents status bar
42
editor.getParentEditor().getStatusBar().updateMessage();
43       if (!(editor.getParentEditor() instanceof PackageEditor)) {
44          JaWE.getInstance().getPackageEditor().getStatusBar().updateMessage();
45       }
46    }
47 }
48
Popular Tags