KickJava   Java API By Example, From Geeks To Geeks.

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


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 allowing to choose a programming language type
31  * in a Node Properties Descriptor
32  *
33  * @author <a HREF="mailto:Christophe.Contreras@lifl.fr">Christophe Contreras</a>
34  *
35  */

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

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

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

57     public
58     ProgramminglanguageType ()
59     {
60         this ("Type");
61     }
62
63     /**
64      * The constructor with a label
65      */

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

94     /**
95      * The getter method
96      */

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

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