KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > adwt > editor > ClassEditor


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

7 package org.ejtools.adwt.editor;
8
9
10
11 /**
12  * Description of the Class
13  *
14  * @author Laurent Etiemble
15  * @version $Revision: 1.5 $
16  * @todo Javadoc to complete
17  */

18 public class ClassEditor extends GenericEditor
19 {
20    /** Constructor */
21    public ClassEditor()
22    {
23       this.value = Class JavaDoc.class;
24    }
25
26
27    /**
28     * Getter for the asText attribute
29     *
30     * @return The value
31     */

32    public String JavaDoc getAsText()
33    {
34       if (this.value != null)
35       {
36          return ((Class JavaDoc) this.value).getName();
37       }
38       else
39       {
40          return null;
41       }
42    }
43
44
45    /**
46     * Setter for the asText attribute
47     *
48     * @param s The new value
49     */

50    public void setAsText(String JavaDoc s)
51    {
52       try
53       {
54          this.value = Thread.currentThread().getContextClassLoader().loadClass(s);
55       }
56       catch (Exception JavaDoc e)
57       {
58       }
59       this.firePropertyChange();
60    }
61 }
62
63
Popular Tags