KickJava   Java API By Example, From Geeks To Geeks.

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


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 code type
31  * for a component implementation
32  *
33  * @author <a HREF="mailto:Christophe.Contreras@lifl.fr">Christophe Contreras</a>
34  *
35  */

36 public class SoftpkgResourceType
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     SoftpkgResourceType ()
59     {
60         this ("Code type");
61     }
62
63     /**
64      * The constructor with a label
65      */

66     public
67     SoftpkgResourceType (String JavaDoc label)
68     {
69         super (label);
70
71         // the possible values
72
String JavaDoc[] values
73          = {
74             "DLL"
75             ,"Executable"
76             ,"Java Class"
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("Java Class");
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