pt.despodata.java.ddata
Class DDataObjectArrayEditor

java.lang.Object
  extended byjava.beans.PropertyEditorSupport
      extended bypt.despodata.java.ddata.DDataObjectArrayEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class DDataObjectArrayEditor
extends java.beans.PropertyEditorSupport

DDataObjectArrayEditor.java Esta classe implementa a interface PropertyEditor e permite editar beans do tipo Object[] com se trata-se de uma lista de strings separadas por virgulas. Company MoreData

Version:
$Revision: 1.2 $
Author:
pcarmo

Constructor Summary
DDataObjectArrayEditor()
           
 
Method Summary
 java.lang.String getAsText()
          Gets the property value as a string suitable for presentation to a human to edit.
 java.lang.String getJavaInitializationString()
          This method is intended for use when generating Java code to set the value of the property.
 java.lang.Object getValue()
          Gets the value of the property.
 void setAsText(java.lang.String s)
          Sets the property value by parsing a given String.
 void setValue(java.lang.Object value)
          Set (or change) the object that is to be edited.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getTags, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDataObjectArrayEditor

public DDataObjectArrayEditor()
Method Detail

setValue

public void setValue(java.lang.Object value)
Set (or change) the object that is to be edited.

Parameters:
value - The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.

getValue

public java.lang.Object getValue()
Gets the value of the property.

Returns:
The value of the property.

getAsText

public java.lang.String getAsText()
Gets the property value as a string suitable for presentation to a human to edit.

Returns:
The property value as a string suitable for presentation to a human to edit.

Returns "null" is the value can't be expressed as a string.

If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().


setAsText

public void setAsText(java.lang.String s)
Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.


getJavaInitializationString

public java.lang.String getJavaInitializationString()
This method is intended for use when generating Java code to set the value of the property. It should return a fragment of Java code that can be used to initialize a variable with the current property value.

Example results are "2", "new Color(127,127,34)", "Color.orange", etc.

Returns:
A fragment of Java code representing an initializer for the current value.