KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > application > ThickClientDialog


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ThickClientDialog.java,v 1.6 2007/01/07 06:14:39 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.core.application;
23
24 import org.opensubsystems.core.error.OSSException;
25 import org.opensubsystems.core.util.ClassFactory;
26
27 /**
28  * Base class for thick client dialogs.
29  *
30  * @version $Id: ThickClientDialog.java,v 1.6 2007/01/07 06:14:39 bastafidli Exp $
31  * @author Miro Halas
32  * @code.reviewer Miro Halas
33  * @code.reviewed 1.4 2006/04/06 13:44:18 bastafidli
34  */

35 public class ThickClientDialog
36 {
37    // Attributes ///////////////////////////////////////////////////////////////
38

39    /**
40     * Thick client displaying this dialog.
41     */

42    protected ThickClient m_client;
43    
44    /**
45     * Thick client dialog displaying this dialog.
46     */

47    protected ThickClientDialog m_parentDialog;
48    
49    /**
50     * Title of the dialog
51     */

52    protected String JavaDoc m_strTitle;
53    
54    /**
55     * Gui this dialog is using.
56     */

57    protected ThickClientDialogGui m_dialogGui;
58
59    // Constructors /////////////////////////////////////////////////////////////
60

61    /**
62     * Constructor.
63     *
64     * @param client - application displaying this dialog
65     * @param strTitle - title of this dialog
66     * @param clsDialogGui - class representing dialog gui. This class will be
67     * instantiated dynamically using gui technology
68     * dependent factory.
69     * @throws OSSException - an error has occured
70     */

71    public ThickClientDialog(
72       ThickClient client,
73       String JavaDoc strTitle,
74       Class JavaDoc clsDialogGui
75    ) throws OSSException
76    {
77       super();
78
79       m_client = client;
80       m_strTitle = strTitle;
81       // m_parentDialog automatically initialized to null
82

83       ClassFactory classFactory;
84       
85       classFactory = new ThickClientDependentClassFactory(m_client);
86       m_dialogGui = (ThickClientDialogGui)classFactory.createInstance(
87                                                           clsDialogGui);
88    }
89    
90    /**
91     * Constructor.
92     *
93     * @param parentDialog - parent dialog displaying this dialog
94     * @param strTitle - title of this dialog
95     * @param clsDialogGui - class representing dialog gui. This class will be
96     * instantiated dynamically using gui technology
97     * dependent factory.
98     * @throws OSSException - an error has occured
99     */

100    public ThickClientDialog(
101       ThickClientDialog parentDialog,
102       String JavaDoc strTitle,
103       Class JavaDoc clsDialogGui
104    ) throws OSSException
105    {
106       this(parentDialog.getClient(), strTitle, clsDialogGui);
107
108       m_parentDialog = parentDialog;
109    }
110    
111    /**
112     * Get client application displaying this dialog. The dialog may not be
113     * displayed directly by application but may be instead displayed by a
114     * different dialog which was displayed by this application.
115     *
116     * @return ThickClientDialogGui
117     */

118    public ThickClient getClient(
119    )
120    {
121       return m_client;
122    }
123
124    /**
125     * Get parent dialog displaying this dialog.
126     *
127     * @return ThickClientDialog - parent dialog displaying this dialog. If this
128     * dialog is displayed directly by application
129     * and this is the first level dialog then this
130     * method will return null.
131     */

132    public ThickClientDialog getParentDialog()
133    {
134       return m_parentDialog;
135    }
136
137    /**
138     * Get gui for this dialog.
139     *
140     * @return ThickClientDialogGui
141     */

142    public ThickClientDialogGui getGui(
143    )
144    {
145       return m_dialogGui;
146    }
147
148    /**
149     * Get title of the dialog.
150     *
151     * @return String - title of the dialog
152     */

153    public String JavaDoc getTitle()
154    {
155       return m_strTitle;
156    }
157 }
158
Popular Tags