Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: openfuture/editxml/applet/AbsDialog.java


1   package openfuture.editxml.applet;
2   
3   /*
4    * This library is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Lesser General Public
6    * License as published by the Free Software Foundation; either
7    * version 2 of the License, or (at your option) any later version.<p>
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   * Lesser General Public License for more details.<p>
13   *
14   * You should have received a copy of the GNU Lesser General Public
15   * License along with this library; if not, write to the Free Software
16   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA<br>
17   * http://www.gnu.org/copyleft/lesser.html
18   */
19  
20  import java.awt.Component;
21  import java.awt.Frame;
22  import java.awt.event.WindowEvent;
23  import java.awt.event.WindowListener;
24  import java.util.ResourceBundle;
25  import javax.swing.JButton;
26  import javax.swing.JDialog;
27  import javax.swing.JLabel;
28  import javax.swing.JOptionPane;
29  import javax.swing.JTextField;
30  import openfuture.editxml.servlet.EditorServletProxy;
31  
32  /**
33   * Configuration Management Information: 
34   * -------------------------------------
35   * $Id: AbsDialog.java,v 1.1 2001/07/22 09:17:44 wreissen Exp $
36   *
37   * Version History:
38   * ----------------
39   * $Log: AbsDialog.java,v $
40   * Revision 1.1  2001/07/22 09:17:44  wreissen
41   * initial version
42   *
43   *
44   */
45  
46  /**
47   * Abstract dialog implementation.<p>
48   *
49   *
50   * Created: Tue Jul 10 19:00:34 2001
51   *
52   * @author <a href="mailto: wolfgang@openfuture.de">Wolfgang Reissenberger</a>
53   * @version $Revision: 1.1 $
54   */
55  
56  public class AbsDialog extends JDialog implements WindowListener {
57  
58  
59      protected Component root;
60  
61      protected String filename;
62      private String domainName;
63      private RootController controller;
64      private ResourceBundle resourceBundle;
65      private EditorServletProxy servletProxy;
66  
67      /**
68       * Creates a new <code>AbsDialog</code> instance.
69       *
70       * @param frame the parent's frame
71       * @param title window title
72       * @param resourceBundle the resource bundle
73       * @param controller the main controller
74       */
75      protected AbsDialog(Frame frame, String title,
76        ResourceBundle resourceBundle,
77        RootController controller) {
78          super(frame, title, true);
79  
80    setController(controller);
81    setResourceBundle(resourceBundle);
82    addWindowListener(this);
83    setDomainName(getController().getDomainName());
84      }
85  
86  
87      /**
88       * Get the value of domainName.
89       * @return value of domainName.
90       */
91      public String getDomainName() {
92    return domainName;
93      }
94      
95      /**
96       * Set the value of domainName.
97       * @param v  Value to assign to domainName.
98       */
99      public void setDomainName(String  v) {
100   this.domainName = v;
101     }
102     
103     /**
104      * Get the value of controller.
105      * @return value of controller.
106      */
107     public RootController getController() {
108   return controller;
109     }
110     
111     /**
112      * Set the value of controller.
113      * @param v  Value to assign to controller.
114      */
115     public void setController(RootController  v) {
116   this.controller = v;
117     }
118     
119     // implementation of java.awt.event.WindowListener interface
120 
121     /**
122      * do nothing
123      *
124      * @param e event
125      */
126     public void windowActivated(WindowEvent e) {
127   // do nothing
128     }
129 
130     /**
131      * do nothing
132      *
133      * @param e event
134      */
135     public void windowClosed(WindowEvent e) {
136   // do nothing
137     }
138 
139     /**
140      * Equal to pressing the cancel button
141      *
142      * @param e event
143      */
144     public void windowClosing(WindowEvent e) {
145   filename = null;
146     }
147 
148     /**
149      * do nothing
150      *
151      * @param e event
152      */
153     public void windowDeactivated(WindowEvent e) {
154   // do nothing
155     }
156 
157     /**
158      * do nothing
159      *
160      * @param e event
161      */
162     public void windowDeiconified(WindowEvent e) {
163   // do nothing
164     }
165 
166     /**
167      * do nothing
168      *
169      * @param e event
170      */
171     public void windowIconified(WindowEvent e) {
172   // do nothing
173     }
174 
175     /**
176      * do nothing
177      *
178      * @param e event
179      */
180     public void windowOpened(WindowEvent e) {
181   // do nothing
182     }
183 
184 
185     /**
186      * Creates a text label.
187      *
188      * @param s label text
189      * @return a <code>JLabel</code> value
190      */
191     public JLabel createLabel(String s) {
192     JLabel theLabel = new JLabel(getResourceBundle().getString(s));
193 
194     return(theLabel);
195     }
196 
197 
198     /**
199      * Creates a text field
200      *
201      * @param name the component's name.
202      * @param s initial text.
203      * @return a <code>JTextField</code> value
204      */
205     public JTextField createTextField(String name, String s) {
206     JTextField theField = new JTextField(s);
207   theField.setName(name);
208   theField.setActionCommand(name);
209     return(theField);
210     }
211 
212     /**
213      * Create a button.
214      *
215      * @param s button text
216      * @return a <code>JButton</code> value
217      */
218     public JButton createButton(String s) {
219     JButton theButton = new JButton(getResourceBundle().getString(s));
220   theButton.setActionCommand(s);
221     return(theButton);
222     }
223 
224     /**
225      * Get the value of resourceBundle.
226      * @return value of resourceBundle.
227      */
228     public ResourceBundle getResourceBundle() {
229   return resourceBundle;
230     }
231     
232     /**
233      * Set the value of resourceBundle.
234      * @param v  Value to assign to resourceBundle.
235      */
236     public void setResourceBundle(ResourceBundle  v) {
237   this.resourceBundle = v;
238     }
239 
240     
241     /**
242      * Get the value of servletProxy.
243      * @return value of servletProxy.
244      */
245     public EditorServletProxy getServletProxy() {
246   return servletProxy;
247     }
248     
249     /**
250      * Set the value of servletProxy.
251      * @param v  Value to assign to servletProxy.
252      */
253     public void setServletProxy(EditorServletProxy  v) {
254   servletProxy = v;
255     }
256     
257     /**
258      * Get the value of root.
259      * @return value of root.
260      */
261     public Component getRoot() {
262   return root;
263     }
264     
265     /**
266      * Set the value of root.
267      * @param v  Value to assign to root.
268      */
269     public void setRoot(Component  v) {
270   root = v;
271     }
272     
273 }// AbsDialog