KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > packaging > widgets > NetworkWithFirewall


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library 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 GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Christophe Contreras
23 Contributor(s): ___________________________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.packaging.widgets;
28
29 /**
30  * This is a widget to setup a network protocol
31  * in a Node Property Descriptor
32  * to indicate a firewall running
33  *
34  * @author <a HREF="mailto:Christophe.Contreras@lifl.fr">Christophe Contreras</a>
35  *
36  */

37 public class NetworkWithFirewall
38      extends org.objectweb.apollon.gui.bricks.AbstractBrick
39 {
40     // ==================================================================
41
//
42
// Internal state.
43
//
44
// ==================================================================
45

46     /** the swing scroll list */
47     private javax.swing.JComboBox JavaDoc scrolling_list;
48
49     // ==================================================================
50
//
51
// Constructors.
52
//
53
// ==================================================================
54

55     /**
56      * The default constructor.
57      */

58     public
59     NetworkWithFirewall ()
60     {
61         this ("Firewall ?");
62     }
63
64     /**
65      * The constructor with a label
66      */

67     public
68     NetworkWithFirewall (String JavaDoc label)
69     {
70         super (label);
71
72         // the possible values
73
String JavaDoc[] values
74          = {
75             "true"
76             ,"false"
77             };
78
79         // inits the scroll list
80
scrolling_list = new javax.swing.JComboBox JavaDoc(values);
81
82         // sets a default value in the list
83
set("false");
84         scrolling_list.validate();
85
86         this.add(this.scrolling_list);
87     }
88
89     // ==================================================================
90
//
91
// Public methods.
92
//
93
// ==================================================================
94

95     /**
96      * The getter method
97      */

98     public String JavaDoc
99     get()
100     {
101         return (String JavaDoc)this.scrolling_list.getSelectedItem();
102     }
103
104     /**
105      * The setter method
106      */

107     public void
108     set (String JavaDoc resource_type)
109     {
110         this.scrolling_list.setSelectedItem(resource_type);
111     }
112 }
113
Popular Tags