|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.widget.form.NumberPropertyEditor
public class NumberPropertyEditor
PropertyEditory
that uses a NumberFormat
. When
converting a Number to a String, if a format has not been specified, toString
will be called on the passed Number. When converting from a String to a
Number, the number type (setType(Class)
will be used to determine
the new number instance type.
NumberPropertyEditor editor = new NumberPropertyEditor(Integer.class);
NumberFormat
Field Summary | |
---|---|
protected java.lang.String |
alpahRegex
|
protected java.lang.String |
currencySymbolRegex
|
protected com.google.gwt.i18n.client.NumberFormat |
format
|
protected java.lang.String |
groupSeparator
|
protected com.google.gwt.i18n.client.constants.NumberConstants |
numbers
|
protected java.lang.Class<?> |
type
|
Fields inherited from interface com.extjs.gxt.ui.client.widget.form.PropertyEditor |
---|
DEFAULT |
Constructor Summary | |
---|---|
NumberPropertyEditor()
Creates a new number property editor with the default number type (Double). |
|
NumberPropertyEditor(java.lang.Class<?> type)
Creates a new number property editor. |
|
NumberPropertyEditor(com.google.gwt.i18n.client.NumberFormat format)
Creates a new number property editor. |
|
NumberPropertyEditor(java.lang.String pattern)
Creates a new number property editor. |
Method Summary | |
---|---|
java.lang.Number |
convertStringValue(java.lang.String value)
Converts a string to the typed value. |
com.google.gwt.i18n.client.NumberFormat |
getFormat()
Returns the editor's format. |
java.lang.String |
getStringValue(java.lang.Number value)
Returns the data as a string. |
java.lang.Class<?> |
getType()
Returns the number class. |
boolean |
isStripAlphas()
Returns true if alpha characters are being removed. |
boolean |
isStripCurrencySymbol()
Returns true if the currency symbol is being removed. |
boolean |
isStripGroupSeparator()
Returns true if the group separator is being removed before parsing a string value. |
protected java.lang.Number |
returnTypedValue(java.lang.Number number)
|
void |
setFormat(com.google.gwt.i18n.client.NumberFormat format)
Sets the editor's format. |
void |
setStripAlphas(boolean stripAlphas)
True to remove alpha characters when parsing a string value (defaults to false). |
void |
setStripCurrencySymbol(boolean stripCurrencySymbol)
True to remove the currency symbol when parsing a string value (defaults to false). |
void |
setStripGroupSeparator(boolean stripGroupSeparator)
True to remove the group separator, as defined by GWT NumberConstants, when parsing a string value (defaults to false). |
void |
setType(java.lang.Class<?> type)
Sets the number type used when converting a string to a number. |
protected java.lang.String |
stripValue(java.lang.String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.google.gwt.i18n.client.constants.NumberConstants numbers
protected com.google.gwt.i18n.client.NumberFormat format
protected java.lang.String alpahRegex
protected java.lang.String currencySymbolRegex
protected java.lang.String groupSeparator
protected java.lang.Class<?> type
Constructor Detail |
---|
public NumberPropertyEditor()
public NumberPropertyEditor(java.lang.Class<?> type)
type
- the number class (Short, Integer, Long, Float, Double)public NumberPropertyEditor(com.google.gwt.i18n.client.NumberFormat format)
format
- the number formatpublic NumberPropertyEditor(java.lang.String pattern)
pattern
- the number format patternMethod Detail |
---|
public java.lang.Number convertStringValue(java.lang.String value)
PropertyEditor
convertStringValue
in interface PropertyEditor<java.lang.Number>
value
- the string value
public com.google.gwt.i18n.client.NumberFormat getFormat()
public java.lang.String getStringValue(java.lang.Number value)
PropertyEditor
getStringValue
in interface PropertyEditor<java.lang.Number>
value
- the typed value
public java.lang.Class<?> getType()
public boolean isStripAlphas()
public boolean isStripCurrencySymbol()
public boolean isStripGroupSeparator()
public void setFormat(com.google.gwt.i18n.client.NumberFormat format)
format
- the formatpublic void setStripAlphas(boolean stripAlphas)
stripAlphas
- true to remove all alpha characterspublic void setStripCurrencySymbol(boolean stripCurrencySymbol)
stripCurrencySymbol
- true to the currency symbolpublic void setStripGroupSeparator(boolean stripGroupSeparator)
stripGroupSeparator
- true to remove the group separatorpublic void setType(java.lang.Class<?> type)
type
- the type (Short, Integer, Long, Float, Double)protected java.lang.Number returnTypedValue(java.lang.Number number)
protected java.lang.String stripValue(java.lang.String value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |