KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > base > tool > ServicesConfigurationPanel


1 /*
2  * Created on Jul 19, 2005
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */

7 package org.enhydra.base.tool;
8
9 import javax.swing.JPanel JavaDoc;
10
11 import javax.swing.JLabel JavaDoc;
12 import javax.swing.JOptionPane JavaDoc;
13 import javax.swing.JTextField JavaDoc;
14 import javax.swing.JCheckBox JavaDoc;
15 /**
16  * @author slobodan
17  *
18  * TODO To change the template for this generated type comment go to
19  * Window - Preferences - Java - Code Style - Code Templates
20  */

21 public class ServicesConfigurationPanel extends JPanel JavaDoc {
22
23     private JCheckBox JavaDoc registryCheck = null;
24     private JCheckBox JavaDoc jmxCheck = null;
25     private JCheckBox JavaDoc securityCheck = null;
26     private JCheckBox JavaDoc jtmCheck = null;
27     private JCheckBox JavaDoc dbCheck = null;
28     private JCheckBox JavaDoc mailCheck = null;
29     private JCheckBox JavaDoc dbmCheck = null;
30     private JCheckBox JavaDoc resourceCheck = null;
31     private JCheckBox JavaDoc jmsCheck = null;
32     private JCheckBox JavaDoc ejbCheck = null;
33     private JCheckBox JavaDoc wsCheck = null;
34     private JCheckBox JavaDoc webCheck = null;
35     private JCheckBox JavaDoc earCheck = null;
36     private JCheckBox JavaDoc discoveryCheck = null;
37     private JLabel JavaDoc jLabel = null;
38     /**
39      * This is the default constructor
40      */

41     public ServicesConfigurationPanel() {
42         super();
43         initialize();
44     }
45     /**
46      * This method initializes this
47      *
48      * @return void
49      */

50     private void initialize() {
51         this.setPreferredSize(new java.awt.Dimension JavaDoc(300,150));
52         jLabel = new JLabel JavaDoc ();
53         jLabel.setText("");
54         jLabel.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
55         this.add(getRegistryCheck(), null);
56         this.add(getJmxCheck(), null);
57         this.add(getSecurityCheck(), null);
58         this.add(getJtmCheck(), null);
59         this.add(getDbCheck(), null);
60         this.add(getMailCheck(), null);
61         this.add(getDbmCheck(), null);
62         this.add(getResourceCheck(), null);
63         this.add(getJmsCheck(), null);
64         this.add(getEjbCheck(), null);
65         this.add(getWsCheck(), null);
66         this.add(getWebCheck(), null);
67         this.add(getEarCheck(), null);
68         this.add(getDiscoveryCheck(), null);
69         this.add(jLabel, null);
70         jLabel = new JLabel JavaDoc();
71         this.setSize(300, 150);
72     }
73     
74     public boolean checkEntries() {
75         boolean valid = true;
76         
77         return valid;
78     }
79
80     private void displayErrorMessage(String JavaDoc field) {
81         JOptionPane.showMessageDialog(null, "Check '" + field
82                 + "' Field Setting!",
83                 "Enhydra Configuration Tool - Houston, we have a problem!",
84                 JOptionPane.ERROR_MESSAGE);
85     }
86     /**
87      * This method initializes jCheckBox
88      *
89      * @return javax.swing.JCheckBox
90      */

91     private JCheckBox JavaDoc getRegistryCheck() {
92         if (registryCheck == null) {
93             registryCheck = new JCheckBox JavaDoc();
94             registryCheck.setName("registryCheck");
95             registryCheck.setText("registry");
96             registryCheck.setToolTipText("registry");
97             registryCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
98             registryCheck.setEnabled(false);
99             registryCheck.setSelected(true);
100         }
101         return registryCheck;
102     }
103     /**
104      * This method initializes jCheckBox
105      *
106      * @return javax.swing.JCheckBox
107      */

108     private JCheckBox JavaDoc getJmxCheck() {
109         if (jmxCheck == null) {
110             jmxCheck = new JCheckBox JavaDoc();
111             jmxCheck.setText("jmx");
112             jmxCheck.setToolTipText("jmx");
113             jmxCheck.setName("jmxCheck");
114             jmxCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
115             jmxCheck.setSelected(true);
116             jmxCheck.setEnabled(false);
117         }
118         return jmxCheck;
119     }
120     /**
121      * This method initializes jCheckBox
122      *
123      * @return javax.swing.JCheckBox
124      */

125     private JCheckBox JavaDoc getSecurityCheck() {
126         if (securityCheck == null) {
127             securityCheck = new JCheckBox JavaDoc();
128             securityCheck.setName("securityCheck");
129             securityCheck.setText("security");
130             securityCheck.setToolTipText("security");
131             securityCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
132             securityCheck.setEnabled(true);
133             securityCheck.setSelected(true);
134         }
135         return securityCheck;
136     }
137     /**
138      * This method initializes jCheckBox
139      *
140      * @return javax.swing.JCheckBox
141      */

142     private JCheckBox JavaDoc getJtmCheck() {
143         if (jtmCheck == null) {
144             jtmCheck = new JCheckBox JavaDoc();
145             jtmCheck.setToolTipText("jtm");
146             jtmCheck.setText("jtm");
147             jtmCheck.setName("jtmCheck");
148             jtmCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
149             jtmCheck.setSelected(true);
150             jtmCheck.setEnabled(false);
151         }
152         return jtmCheck;
153     }
154     /**
155      * This method initializes jCheckBox
156      *
157      * @return javax.swing.JCheckBox
158      */

159     private JCheckBox JavaDoc getDbCheck() {
160         if (dbCheck == null) {
161             dbCheck = new JCheckBox JavaDoc();
162             dbCheck.setToolTipText("db");
163             dbCheck.setText("db");
164             dbCheck.setName("dbCheck");
165             dbCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
166         }
167         return dbCheck;
168     }
169     /**
170      * This method initializes jCheckBox
171      *
172      * @return javax.swing.JCheckBox
173      */

174     private JCheckBox JavaDoc getMailCheck() {
175         if (mailCheck == null) {
176             mailCheck = new JCheckBox JavaDoc();
177             mailCheck.setToolTipText("mail");
178             mailCheck.setText("mail");
179             mailCheck.setName("mailCheck");
180             mailCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
181         }
182         return mailCheck;
183     }
184     /**
185      * This method initializes jCheckBox
186      *
187      * @return javax.swing.JCheckBox
188      */

189     private JCheckBox JavaDoc getDbmCheck() {
190         if (dbmCheck == null) {
191             dbmCheck = new JCheckBox JavaDoc();
192             dbmCheck.setText("dbm");
193             dbmCheck.setToolTipText("dbm");
194             dbmCheck.setName("dbmCheck");
195             dbmCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
196             dbmCheck.setSelected(true);
197         }
198         return dbmCheck;
199     }
200     /**
201      * This method initializes jCheckBox
202      *
203      * @return javax.swing.JCheckBox
204      */

205     private JCheckBox JavaDoc getResourceCheck() {
206         if (resourceCheck == null) {
207             resourceCheck = new JCheckBox JavaDoc();
208             resourceCheck.setToolTipText("resource");
209             resourceCheck.setText("resource");
210             resourceCheck.setName("resourceCheck");
211             resourceCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
212         }
213         return resourceCheck;
214     }
215     /**
216      * This method initializes jCheckBox
217      *
218      * @return javax.swing.JCheckBox
219      */

220     private JCheckBox JavaDoc getJmsCheck() {
221         if (jmsCheck == null) {
222             jmsCheck = new JCheckBox JavaDoc();
223             jmsCheck.setText("jms");
224             jmsCheck.setToolTipText("jms");
225             jmsCheck.setName("jmsCheck");
226             jmsCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
227         }
228         return jmsCheck;
229     }
230     /**
231      * This method initializes jCheckBox
232      *
233      * @return javax.swing.JCheckBox
234      */

235     private JCheckBox JavaDoc getEjbCheck() {
236         if (ejbCheck == null) {
237             ejbCheck = new JCheckBox JavaDoc();
238             ejbCheck.setText("ejb");
239             ejbCheck.setToolTipText("ejb");
240             ejbCheck.setName("ejbCheck");
241             ejbCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
242             ejbCheck.setEnabled(false);
243             ejbCheck.setSelected(true);
244         }
245         return ejbCheck;
246     }
247     /**
248      * This method initializes jCheckBox
249      *
250      * @return javax.swing.JCheckBox
251      */

252     private JCheckBox JavaDoc getWsCheck() {
253         if (wsCheck == null) {
254             wsCheck = new JCheckBox JavaDoc();
255             wsCheck.setText("ws");
256             wsCheck.setToolTipText("ws");
257             wsCheck.setName("wsCheck");
258             wsCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
259             wsCheck.setSelected(true);
260         }
261         return wsCheck;
262     }
263     /**
264      * This method initializes jCheckBox
265      *
266      * @return javax.swing.JCheckBox
267      */

268     private JCheckBox JavaDoc getWebCheck() {
269         if (webCheck == null) {
270             webCheck = new JCheckBox JavaDoc();
271             webCheck.setToolTipText("web");
272             webCheck.setText("web");
273             webCheck.setName("webCheck");
274             webCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
275         }
276         return webCheck;
277     }
278     /**
279      * This method initializes jCheckBox
280      *
281      * @return javax.swing.JCheckBox
282      */

283     private JCheckBox JavaDoc getEarCheck() {
284         if (earCheck == null) {
285             earCheck = new JCheckBox JavaDoc();
286             earCheck.setToolTipText("ear");
287             earCheck.setText("ear");
288             earCheck.setName("earCheck");
289             earCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
290         }
291         return earCheck;
292     }
293     /**
294      * This method initializes jCheckBox
295      *
296      * @return javax.swing.JCheckBox
297      */

298     private JCheckBox JavaDoc getDiscoveryCheck() {
299         if (discoveryCheck == null) {
300             discoveryCheck = new JCheckBox JavaDoc();
301             discoveryCheck.setToolTipText("discovery");
302             discoveryCheck.setText("discovery");
303             discoveryCheck.setName("discoveryCheck");
304             discoveryCheck.setPreferredSize(new java.awt.Dimension JavaDoc(80,20));
305         }
306         return discoveryCheck;
307     }
308     
309     public void setRegistryChecked (boolean selected){
310         getRegistryCheck().setSelected(selected);
311     }
312     
313     public boolean getRegistryChecked (){
314         return getRegistryCheck().isSelected();
315     }
316     
317     public void setJmxChecked (boolean selected){
318         getJmxCheck().setSelected(selected);
319     }
320     
321     public boolean getJmxChecked (){
322         return getJmxCheck().isSelected();
323     }
324     
325     public void setSecurityChecked (boolean selected){
326         getSecurityCheck().setSelected(selected);
327     }
328     
329     public boolean getSecurityChecked (){
330         return getSecurityCheck().isSelected();
331     }
332     
333     public void setJtmChecked (boolean selected){
334         getJtmCheck().setSelected(selected);
335     }
336     
337     public boolean getJtmChecked (){
338         return getJtmCheck().isSelected();
339     }
340     
341     public void setDbChecked (boolean selected){
342         getDbCheck().setSelected(selected);
343     }
344     
345     public boolean getDbChecked (){
346         return getDbCheck().isSelected();
347     }
348     
349     public void setMailChecked (boolean selected){
350         getMailCheck().setSelected(selected);
351     }
352     
353     public boolean getMailChecked (){
354         return getMailCheck().isSelected();
355     }
356     
357     public void setDbmChecked (boolean selected){
358         getDbmCheck().setSelected(selected);
359     }
360     
361     public boolean getDbmChecked (){
362         return getDbmCheck().isSelected();
363     }
364     
365     public void setResourceChecked (boolean selected){
366         getResourceCheck().setSelected(selected);
367     }
368     
369     public boolean getResourceChecked (){
370         return getResourceCheck().isSelected();
371     }
372     
373     public void setJmsChecked (boolean selected){
374         getJmsCheck().setSelected(selected);
375     }
376     
377     public boolean getJmsChecked (){
378         return getJmsCheck().isSelected();
379     }
380     
381     public void setEjbChecked (boolean selected){
382         getEjbCheck().setSelected(selected);
383     }
384     
385     public boolean getEjbChecked (){
386         return getEjbCheck().isSelected();
387     }
388     
389     public void setWsChecked (boolean selected){
390         getWsCheck().setSelected(selected);
391     }
392     
393     public boolean getWsChecked (){
394         return getWsCheck().isSelected();
395     }
396     
397     public void setWebChecked (boolean selected){
398         getWebCheck().setSelected(selected);
399     }
400     
401     public boolean getWebChecked (){
402         return getWebCheck().isSelected();
403     }
404     
405     public void setEarChecked (boolean selected){
406         getEarCheck().setSelected(selected);
407     }
408     
409     public boolean getEarChecked (){
410         return getEarCheck().isSelected();
411     }
412     
413     public void setDiscoveryChecked (boolean selected){
414         getDiscoveryCheck().setSelected(selected);
415     }
416     
417     public boolean getDiscoveryChecked (){
418         return getDiscoveryCheck().isSelected();
419     }
420     
421     public String JavaDoc getSelectedServices(){
422         String JavaDoc services = "";
423         if (getRegistryChecked()){
424             services += "registry,";
425         }
426         if (getJmxChecked()){
427             services += "jmx,";
428         }
429         if (getSecurityChecked()){
430             services += "security,";
431         }
432         if (getJtmChecked()){
433             services += "jtm,";
434         }
435         if (getDbChecked()){
436             services += "db,";
437         }
438         if (getMailChecked()){
439             services += "mail,";
440         }
441         if (getDbmChecked()){
442             services += "dbm,";
443         }
444         if (getResourceChecked()){
445             services += "resource,";
446         }
447         if (getJmsChecked()){
448             services += "jms,";
449         }
450         if (getEjbChecked()){
451             services += "ejb,";
452         }
453         if (getWsChecked()){
454             services += "ws,";
455         }
456         if (getWebChecked()){
457             services += "web,";
458         }
459         if (getEarChecked()){
460             services += "ear,";
461         }
462         if (getDiscoveryChecked()){
463             services += "discovery,";
464         }
465         
466         return services.substring(0,services.length()-1);
467     }
468 }
469
Popular Tags