|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.components.numberfield.DefaultNumberDescriptor
public class DefaultNumberDescriptor
DefaultNumberDescriptor
is a default implementaion of the
NumberDescriptor interface.
Field Summary | |
---|---|
static java.lang.String |
DESCRIPTION
|
static java.lang.String |
NAME
|
Constructor Summary | |
---|---|
DefaultNumberDescriptor()
|
Method Summary | |
---|---|
java.lang.String |
getFormat()
Returns the format |
java.lang.Class |
getNumberType()
Returns last set number type. |
java.lang.Number |
parseNumber(java.lang.String number)
Parses string and creates Number . |
java.lang.String |
printEditString(java.lang.Number number)
Converts provided Number to a string, which is displayed
when NumberField enters in to edit mode and wants to edit value. |
java.lang.String |
printString(java.lang.Number number)
Converts provided Number to a string, which is used for
displaying the value. |
void |
setFormat(java.lang.String format)
Set the Number format |
void |
setNumberType(java.lang.Class newClass)
Supported types are Double.class and
Long.class . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME
NumberDescriptor
,
Constant Field Valuespublic static final java.lang.String DESCRIPTION
NumberDescriptor
,
Constant Field ValuesConstructor Detail |
---|
public DefaultNumberDescriptor()
Method Detail |
---|
public java.lang.Number parseNumber(java.lang.String number)
NumberDescriptor
Number
. If string is not
presentation of a number and can not be parsed, then null must be
returned.
parseNumber
in interface NumberDescriptor
number
- a string representing a number
Number
or null
if string
can not be parsedpublic java.lang.String printString(java.lang.Number number)
NumberDescriptor
Number
to a string, which is used for
displaying the value.
printString
in interface NumberDescriptor
number
- a number to be transformed to string
String
representing a number.public java.lang.String printEditString(java.lang.Number number)
NumberDescriptor
Number
to a string, which is displayed
when NumberField enters in to edit mode and wants to edit value. Edit
string is usually stripped from unnecessary characters and prepared for
easyer user editing.
printEditString
in interface NumberDescriptor
number
- a number to be transformed to string
String
representation a number prepared for
editing.public java.lang.String getFormat()
NumberDescriptor
getFormat
in interface NumberDescriptor
public void setFormat(java.lang.String format)
NumberDescriptor
setFormat
in interface NumberDescriptor
public void setNumberType(java.lang.Class newClass)
Double.class
and
Long.class
.
setNumberType
in interface NumberDescriptor
newClass
- number typeNumberDescriptor.setNumberType(java.lang.Class)
public java.lang.Class getNumberType()
NumberDescriptor
getNumberType
in interface NumberDescriptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |