|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ClassEditor.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 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 | 0 |
public ClassEditor()
|
| 22 |
{
|
|
| 23 | 0 |
this.value = Class.class; |
| 24 |
} |
|
| 25 |
|
|
| 26 |
|
|
| 27 |
/**
|
|
| 28 |
* Getter for the asText attribute
|
|
| 29 |
*
|
|
| 30 |
* @return The value
|
|
| 31 |
*/
|
|
| 32 | 0 |
public String getAsText()
|
| 33 |
{
|
|
| 34 | 0 |
if (this.value != null) |
| 35 |
{
|
|
| 36 | 0 |
return ((Class) this.value).getName(); |
| 37 |
} |
|
| 38 |
else
|
|
| 39 |
{
|
|
| 40 | 0 |
return null; |
| 41 |
} |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
|
|
| 45 |
/**
|
|
| 46 |
* Setter for the asText attribute
|
|
| 47 |
*
|
|
| 48 |
* @param s The new value
|
|
| 49 |
*/
|
|
| 50 | 0 |
public void setAsText(String s) |
| 51 |
{
|
|
| 52 | 0 |
try
|
| 53 |
{
|
|
| 54 | 0 |
this.value = Thread.currentThread().getContextClassLoader().loadClass(s);
|
| 55 |
} |
|
| 56 |
catch (Exception e)
|
|
| 57 |
{
|
|
| 58 |
} |
|
| 59 | 0 |
this.firePropertyChange();
|
| 60 |
} |
|
| 61 |
} |
|
| 62 |
|
|
| 63 |
|
|
||||||||||