public class RectangleEditor extends PropertyEditorSupport
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_VALUE |
PROP_VALUE_VALID, PROPERTY_HELP_ID
Constructor and Description |
---|
RectangleEditor() |
Modifier and Type | Method and Description |
---|---|
void |
attachEnv(PropertyEnv env) |
String |
getAsText() |
Component |
getCustomEditor() |
String |
getJavaInitializationString()
This method is intended for use when generating Java code to set
the value of the property.
|
protected String |
getXMLValueTag()
Provides name of XML tag to use for XML persistence of the property value
|
void |
readFromXML(Node element)
Called to load property value from specified XML subtree.
|
void |
setAsText(String text)
Set the property value by parsing a given String.
|
Node |
storeToXML(Document doc)
Called to store current property value into XML subtree.
|
boolean |
supportsCustomEditor() |
addPropertyChangeListener, firePropertyChange, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setValue
public static final String ATTR_VALUE
public boolean supportsCustomEditor()
supportsCustomEditor
in interface PropertyEditor
supportsCustomEditor
in class PropertyEditorSupport
public Component getCustomEditor()
getCustomEditor
in interface PropertyEditor
getCustomEditor
in class PropertyEditorSupport
protected String getXMLValueTag()
public void attachEnv(PropertyEnv env)
attachEnv
in interface ExPropertyEditor
public String getJavaInitializationString()
Example results are "2", "new Color(127,127,34)", "Color.orange", etc.
getJavaInitializationString
in interface PropertyEditor
getJavaInitializationString
in class PropertyEditorSupport
public String getAsText()
getAsText
in interface PropertyEditor
getAsText
in class PropertyEditorSupport
Returns null if the value can't be expressed as an editable string.
If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().
public void setAsText(String text) throws IllegalArgumentException
setAsText
in interface PropertyEditor
setAsText
in class PropertyEditorSupport
text
- The string to be parsed.IllegalArgumentException
public void readFromXML(Node element) throws IOException
readFromXML
in interface XMLPropertyEditor
element
- the XML DOM element representing a subtree of XML from which the value should be loadedIOException
- thrown when the value cannot be restored from the specified XML elementpublic Node storeToXML(Document doc)
storeToXML
in interface XMLPropertyEditor
doc
- The XML document to store the XML in - should be used for creating nodes only