N
- the number typepublic class NumberField<N extends Number> extends TwinTriggerField<N>
A NumberPropertyEditor must be passed at construction which is used to convert strings to typed number and from typed numbers to strings.
Field.FieldStyles
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasDirection.Direction
DEBUG_ID_PREFIX
Constructor and Description |
---|
NumberField(NumberInputCell<N> cell,
NumberPropertyEditor<N> editor)
Creates a new number field.
|
NumberField(NumberPropertyEditor<N> editor)
Creates a new number field.
|
Modifier and Type | Method and Description |
---|---|
String |
getBaseChars()
Returns the base characters.
|
NumberInputCell<N> |
getCell()
Get the
Cell wrapped by this widget. |
String |
getDecimalSeparator()
Returns the decimal separator.
|
NumberPropertyEditor<N> |
getPropertyEditor()
Returns the field's property editor.
|
boolean |
isAllowDecimals()
Returns true of decimal values are allowed.
|
boolean |
isAllowNegative()
Returns true if negative values are allowed.
|
void |
setAllowDecimals(boolean allowDecimals)
Sets whether decimal value are allowed (defaults to true).
|
void |
setAllowNegative(boolean allowNegative)
Sets whether negative value are allowed to be entered into the field
(defaults to true).
|
void |
setBaseChars(String baseChars)
Sets the base set of characters to evaluate as valid numbers (defaults to
'0123456789').
|
void |
setDecimalSeparator(String decimalSeparator)
Sets the decimal separator (defaults to
LocaleInfo.getCurrentLocale().getNumberConstants().decimalSeparator()).
|
void |
setFormat(NumberFormat format)
Sets the cell's number formatter.
|
addTwinTriggerClickHandler
addTriggerClickHandler, isEditable, isFinishEditOnEnter, isMonitorTab, setEditable, setFinishEditOnEnter, setHideTrigger, setMonitorTab
addChangeHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addParseErrorHandler, clear, getCurrentValue, getCursorPos, getDirection, getDirectionEstimator, getEmptyText, getSelectedText, getSelectionLength, getText, getValueOrThrow, isAllowBlank, isClearValueOnParseError, isCurrentValid, isCurrentValid, isReadOnly, isSelectOnFocus, select, selectAll, setAllowBlank, setClearValueOnParseError, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setEmptyText, setId, setPropertyEditor, setReadOnly, setSelectionRange, setSelectOnFocus, setTabIndex, setText, setValue, validateCurrent
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, clearInvalid, finishEditing, flush, forceInvalid, getErrors, getErrorSupport, getName, getOriginalValue, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isValid, isValid, markInvalid, onBrowserEvent, onPropertyChange, removeValidator, reset, setAutoValidate, setDelegate, setErrorSupport, setName, setOriginalValue, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validate
getElement, getKeyProvider, getValue, redraw, setValue
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
getValue
addBlurHandler
public NumberField(NumberInputCell<N> cell, NumberPropertyEditor<N> editor)
cell
- the number input celleditor
- the property editor@UiConstructor public NumberField(NumberPropertyEditor<N> editor)
editor
- the property editorpublic String getBaseChars()
public NumberInputCell<N> getCell()
CellComponent
Cell
wrapped by this widget.getCell
in class TriggerField<N extends Number>
Cell
being wrappedpublic String getDecimalSeparator()
public NumberPropertyEditor<N> getPropertyEditor()
ValueBaseField
getPropertyEditor
in class ValueBaseField<N extends Number>
public boolean isAllowDecimals()
public boolean isAllowNegative()
public void setAllowDecimals(boolean allowDecimals)
allowDecimals
- true to allow decimal valuespublic void setAllowNegative(boolean allowNegative)
MinNumberValidator
for that.allowNegative
- true to allow negative valuespublic void setBaseChars(String baseChars)
baseChars
- the base characterspublic void setDecimalSeparator(String decimalSeparator)
decimalSeparator
- the decimal separatorpublic void setFormat(NumberFormat format)
format
- the formatCopyright © 2015. All rights reserved.