Node.IndexedProperty, PropertySupport, PropertySupport.Reflectionpublic abstract static class Node.Property<T>
extends java.beans.FeatureDescriptor
You may associate context help with this object, if desired, by setting
a custom property with the name helpID
and value of type String giving a help ID.
Normally this is unnecessary as help for the whole Node will be used by default.
Important: the code name you use for the
property is relevant not only for making properties of a node unique, but also for
firing property changes.
| Constructor | Description |
|---|---|
Property(java.lang.Class<T> valueType) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
abstract boolean |
canRead() |
Test whether the property is readable.
|
abstract boolean |
canWrite() |
Test whether the property is writable.
|
boolean |
equals(java.lang.Object property) |
|
java.lang.String |
getHtmlDisplayName() |
Return a variant of the display name containing HTML markup
conforming to the limited subset of font-markup HTML supported by
the lightweight HTML renderer
HtmlRenderer
(font color, bold, italic and strike-through supported; font
colors can be UIManager color keys if they are prefixed with
a ! character, i.e. |
java.beans.PropertyEditor |
getPropertyEditor() |
Get a property editor for this property.
|
abstract T |
getValue() |
Get the value.
|
java.lang.Class<T> |
getValueType() |
Get the value type.
|
int |
hashCode() |
|
boolean |
isDefaultValue() |
This method indicates whether the current value is the same as
the value that would otherwise be restored by calling
restoreDefaultValue() (if supportsDefaultValue()
returns true). |
void |
restoreDefaultValue() |
Restore this property to its default value, if supported.
|
abstract void |
setValue(T val) |
Set the value.
|
boolean |
supportsDefaultValue() |
Test whether the property had a default value.
|
public Property(java.lang.Class<T> valueType)
valueType - type of the propertypublic java.lang.Class<T> getValueType()
Boolean.class means that values are Boolean
objects; to specify the primitive type, use e.g. Boolean.TYPE.
In the latter case, getValue() and setValue(T) will still operate on the wrapper object.public abstract boolean canRead()
true if it ispublic abstract T getValue() throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException - cannot access the called methodjava.lang.reflect.InvocationTargetException - an exception during invocationpublic abstract boolean canWrite()
true if the read of the value is supportedpublic abstract void setValue(T val) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
val - the new value of the propertyjava.lang.IllegalAccessException - cannot access the called methodjava.lang.IllegalArgumentException - wrong argumentjava.lang.reflect.InvocationTargetException - an exception during invocationpublic boolean supportsDefaultValue()
true if it does (false by default)public void restoreDefaultValue()
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
setValue(default).
Note that it is not permitted for this call to throw IllegalArgumentException,
though the other two exceptions from setValue(T) may be passed through.java.lang.IllegalAccessException - cannot access the called methodjava.lang.reflect.InvocationTargetException - an exception during invocationpublic boolean isDefaultValue()
restoreDefaultValue() (if supportsDefaultValue()
returns true). The default implementation returns true and
it is recommended to also return true when supportsDefaultValue()
returns false (if we do not support default value any value can
be considered as the default). If supportsDefaultValue()
returns false this method will not be called by the default
implementation of property sheet.public java.beans.PropertyEditor getPropertyEditor()
PropertyEditorManager. If a property
editor is found, its instance is cached using SoftReference.
Caching happens per thread - e.g. it is guaranteed that multiple
threads accessing the editor will get different instance.null if there is no editorpublic boolean equals(java.lang.Object property)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getHtmlDisplayName()
HtmlRenderer
(font color, bold, italic and strike-through supported; font
colors can be UIManager color keys if they are prefixed with
a ! character, i.e. <font color=&'controlShadow'>).
Enclosing HTML tags are not needed.
This method should return either an HTML display name or null; it should not return the non-HTML display name.
HtmlRendererBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.