KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > model > Node


1 /*
2
3  * EJTools, the Enterprise Java Tools
4
5  *
6
7  * Distributable under LGPL license.
8
9  * See terms of license at www.gnu.org.
10
11  */

12
13 package org.ejtools.jmx.browser.model;
14
15
16
17 import java.awt.Component JavaDoc;
18
19 import java.beans.Customizer JavaDoc;
20
21 import java.beans.beancontext.BeanContextChildComponentProxy JavaDoc;
22
23 import java.util.Iterator JavaDoc;
24
25
26
27 import org.ejtools.adwt.GenericCustomizer;
28
29 import org.ejtools.beans.Sort;
30
31 import org.ejtools.beans.beancontext.CustomBeanContextServicesSupport;
32
33
34
35 /**
36
37  * Description of the Class
38
39  *
40
41  * @author letiemble
42
43  * @created 13 décembre 2001
44
45  * @version $Revision: 1.6 $
46
47  * @todo Javadoc to complete
48
49  */

50
51 public abstract class Node extends CustomBeanContextServicesSupport implements BeanContextChildComponentProxy JavaDoc
52
53 {
54
55    /** Description of the Field */
56
57    protected transient Customizer JavaDoc c = null;
58
59    /** Description of the Field */
60
61    protected String JavaDoc className = "<undefined>";
62
63    /** Description of the Field */
64
65    protected String JavaDoc name = "<undefined>";
66
67
68
69
70
71    /** Constructor for the Node object */
72
73    public Node()
74
75    {
76
77       super();
78
79    }
80
81
82
83    /**
84
85     * Getter for the className attribute
86
87     *
88
89     * @return The value
90
91     */

92
93    public String JavaDoc getClassName()
94
95    {
96
97       return this.className;
98
99    }
100
101
102
103
104
105    /**
106
107     * Gets the component attribute of the Node object
108
109     *
110
111     * @return The component value
112
113     */

114
115    public Component JavaDoc getComponent()
116
117    {
118
119       if (c == null)
120
121       {
122
123          c = new GenericCustomizer(true, this);
124
125       }
126
127       return (Component JavaDoc) c;
128
129    }
130
131
132
133
134
135    /**
136
137     * Gets the name attribute of the Node object
138
139     *
140
141     * @return The name value
142
143     */

144
145    public String JavaDoc getName()
146
147    {
148
149       return this.name;
150
151    }
152
153
154
155
156
157    /**
158
159     * Description of the Method
160
161     *
162
163     * @return Description of the Returned Value
164
165     */

166
167    public Iterator JavaDoc iterator()
168
169    {
170
171       return Sort.sortByClassAndName(super.iterator());
172
173    }
174
175
176
177
178
179    /**
180
181     * Description of the Method
182
183     *
184
185     * @return Description of the Returned Value
186
187     */

188
189    public String JavaDoc toString()
190
191    {
192
193       return (name == null || "".equals(name)) ? "Default" : name;
194
195    }
196
197
198
199
200
201    /**
202
203     * Setter for the name attribute
204
205     *
206
207     * @param name The new name value
208
209     */

210
211    protected void setName(String JavaDoc name)
212
213    {
214
215       String JavaDoc old = this.name;
216
217       this.name = name;
218
219       this.firePropertyChange("name", old, this.name);
220
221    }
222
223 }
224
225
Popular Tags