| An abstract property editor base class for editors that deal with numbers.
Values submitted must be valid numbers, and must fall within the default
range for the type of number, of the range specified by the user, whichever
is most restrictive. Range values may be supplied as the property descriptor
attributes MIN_VALUE and MAX_VALUE .
This editor class may be used with properties of type string, or of any
type that inherits from
java.lang.Number or an atomic number type. If
used with a property of type string, numbers will be converted to strings
before being returned by getValue().
This editor class supports the notion of an "unset" or "null" value.
Normally, a number editor's value is what it displays. If a non-numeric string
is submitted as a candidate text value, the setAsText(String)
method will throw an illegal argument exception, causing the previous,
correct value to be restored. However, if the editor is configured to
accept an "unset" vaue (using the property descriptor attribute
UNSET_VALUE ), submitting an empty string will cause the editor
to return the specified unset value as its new value. When thus configured,
the editor maintains a map between one numeric value and the empty text
string. Note that the caller of the editor's getValue() method
cannot distinguish between the case where the value, if equal to the "unset"
value, is being returned because the user entered the empty string, or
because the user explicitly typed it in. For the purposes of triggering an
"unset" value, a string consisting of only blank characters is considered
empty.
author: gjmurphy |