KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.objectweb.openccm.packaging.CCMIdRefsSingleton;
30
31 /**
32  * This is a widget allowing to select component files from a list
33  *
34  * @author <a HREF="mailto:Christophe.Contreras@lifl.fr">Christophe Contreras</a>
35  *
36  */

37 public class AssemblyComponentFile
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     AssemblyComponentFile ()
60     {
61         this("idref");
62     }
63     
64     /**
65      * The constructor taking a label
66      *
67      * @param String label the label to use
68      */

69     public
70     AssemblyComponentFile (String JavaDoc label)
71     {
72         super(label);
73         
74         // inits the scroll list
75
scrolling_list = new javax.swing.JComboBox JavaDoc(
76             (String JavaDoc[])
77                 CCMIdRefsSingleton.getInstance()
78                     .getComponentFilesList()
79                     .toArray(new String JavaDoc[0])
80             );
81
82         scrolling_list.setEditable(true);
83
84         this.add(this.scrolling_list);
85     }
86
87     // ==================================================================
88
//
89
// Public methods.
90
//
91
// ==================================================================
92

93     /**
94      * The getter method
95      */

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

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