|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.form.Field
com.gwtext.client.widgets.form.TextField
com.gwtext.client.widgets.form.NumberField
public class NumberField
Numeric text field that provides automatic keystroke filtering and numeric validation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
NumberField()
Creates a new NumberField. |
|
NumberField(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
NumberField(java.lang.String fieldLabel)
|
|
NumberField(java.lang.String fieldLabel,
java.lang.String name)
|
|
NumberField(java.lang.String fieldLabel,
java.lang.String name,
int width)
|
|
NumberField(java.lang.String fieldLabel,
java.lang.String name,
int width,
float value)
|
Method Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.Number |
getValue()
Returns the field value. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
setAllowDecimals(boolean allowDecimals)
False to disallow decimal values (defaults to true). |
void |
setAllowNegative(boolean allowNegative)
False to prevent entering a negative sign (defaults to true). |
void |
setDecimalPrecision(int decimalPrecision)
The maximum precision to display after the decimal separator (defaults to 2). |
void |
setDecimalSeparator(java.lang.String decimalSeparator)
Character(s) to allow as the decimal separator (defaults to '.'). |
void |
setMaxText(java.lang.String maxText)
Error text to display if the maximum value validation fails (defaults to "The maximum value for this field is {maxValue}"). |
void |
setMaxValue(int maxValue)
The maximum allowed value (defaults to Number.MAX_VALUE). |
void |
setMinText(java.lang.String minText)
Error text to display if the minimum value validation fails (defaults to "The minimum value for this field is {minValue}"). |
void |
setMinValue(int minValue)
The minimum allowed value (defaults to Number.NEGATIVE_INFINITY). |
void |
setNanText(java.lang.String nanText)
Error text to display if the value is not a valid number. |
void |
setRemoveTrailingZeros(boolean removeTrailZeros)
This method removes trailing zeros after the last non-zero after the decimal point. |
void |
setValue(float value)
Sets the fields value regardless if the field is rendered or not |
void |
setValue(java.lang.Number value)
Sets the fields value. |
boolean |
validateValue(float value)
Validates a value according to the field's validation rules and marks the field as invalid if the validation fails. |
boolean |
validateValue(java.lang.Number value)
Validates a value according to the field's validation rules and marks the field as invalid if the validation fails. |
Methods inherited from class com.gwtext.client.widgets.form.TextField |
---|
addKeyListener, addKeyListener, addKeyListener, addKeyPressListener, addKeyPressListener, addListener, autoSize, getCaretPosition, getConfigPrototype, getText, getValidator, insertAtCaret, selectText, selectText, setAllowBlank, setBlankText, setCaretPosition, setDisableKeyFilter, setEmptyClass, setEmptyText, setGrow, setGrowMax, setGrowMin, setMaskRe, setMaxLength, setMaxLengthText, setMinLength, setMinLengthText, setPassword, setRegex, setRegexText, setSelectOnFocus, setValidator, setVtype, setVtypeText, validateValue |
Methods inherited from class com.gwtext.client.widgets.form.Field |
---|
addListener, applyTo, applyTo, clearInvalid, getClearCls, getCls, getFieldLabel, getFocusClass, getInputType, getInvalidClass, getInvalidText, getLabelSeparator, getLabelStyle, getName, getRawValue, getTabindex, getValidationDelay, getValueAsString, hide, isAutoCreate, isDirty, isHideLabel, isReadOnly, isValid, isValid, isValidateOnBlur, markInvalid, reset, setAutoCreate, setAutoCreate, setClearCls, setCls, setDisabled, setFieldClass, setFieldLabel, setFieldMsgTarget, setFocusClass, setHideLabel, setInputType, setInvalidClass, setInvalidText, setLabel, setLabelSeparator, setLabelStyle, setMsgFx, setMsgTarget, setName, setRawValue, setReadOnly, setTabIndex, setValidateOnBlur, setValidationDelay, setValidationEvent, setValidationEvent, setValue, show, validate |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumberField()
public NumberField(java.lang.String fieldLabel)
public NumberField(java.lang.String fieldLabel, java.lang.String name)
public NumberField(java.lang.String fieldLabel, java.lang.String name, int width)
public NumberField(java.lang.String fieldLabel, java.lang.String name, int width, float value)
public NumberField(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
create
in class TextField
public java.lang.Number getValue()
public void setValue(float value)
value
- the value to set the fieldpublic void setValue(java.lang.Number value)
value
- the field valuepublic boolean validateValue(java.lang.Number value)
value
- the value to validate
public boolean validateValue(float value)
value
- the value to validate
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class TextField
public void setAllowDecimals(boolean allowDecimals) throws java.lang.IllegalStateException
allowDecimals
- false to disallow decimal values
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setAllowNegative(boolean allowNegative) throws java.lang.IllegalStateException
allowNegative
- false to prevent entering a negative sign
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDecimalPrecision(int decimalPrecision) throws java.lang.IllegalStateException
decimalPrecision
- the decimal precision
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setRemoveTrailingZeros(boolean removeTrailZeros) throws java.lang.IllegalStateException
removeTrailZeros
- true to remove trailing zeros
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDecimalSeparator(java.lang.String decimalSeparator) throws java.lang.IllegalStateException
decimalSeparator
- decimal separator
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMaxText(java.lang.String maxText)
maxText
- the max error textpublic void setMaxValue(int maxValue)
maxValue
- the max valuepublic void setMinText(java.lang.String minText)
minText
- the min error textpublic void setMinValue(int minValue)
minValue
- the min valuepublic void setNanText(java.lang.String nanText)
nanText
- the Nan text
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |