N
- the numeric field typepublic class SpinnerField<N extends Number & Comparable<N>> extends TwinTriggerField<N>
NumberPropertyEditor
for number property editors you can use with
spinner field.Modifier and Type | Class and Description |
---|---|
protected class |
SpinnerField.DefaultSpinnerMessages |
static interface |
SpinnerField.SpinnerMessages
The locale-sensitive messages used by this class.
|
Field.FieldStyles
Modifier and Type | Field and Description |
---|---|
protected SpinnerField.SpinnerMessages |
messages |
impl
forceInvalidText, hasFocus, name, originalValue, parseError, preventMark, validationTask
valueUpdater
adjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask
Constructor and Description |
---|
SpinnerField(NumberPropertyEditor<N> editor)
Creates a spinner field with the specified property editor.
|
SpinnerField(SpinnerFieldCell<N> cell)
Creates a spinner field with the specified cell.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addBeforeSelectionHandler(<any> handler) |
HandlerRegistration |
addSelectionHandler(<any> handler) |
SpinnerFieldCell<N> |
getCell()
Get the
Cell wrapped by this widget. |
Number |
getIncrement(Context context)
Sets the increment value.
|
Number |
getMaxValue()
Returns the fields max value.
|
SpinnerField.SpinnerMessages |
getMessages()
Returns the locale-sensitive messages used by this class.
|
Number |
getMinValue()
Returns the field's minimum value.
|
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.
|
void |
setIncrement(N increment)
Sets the increment that should be used (defaults to 1d).
|
void |
setMaxValue(N maxValue)
Sets the field's max allowable value.
|
void |
setMessages(SpinnerField.SpinnerMessages messages)
Sets the spinner field messages.
|
void |
setMinValue(Number minValue)
Sets the field's minimum allowed value.
|
void |
setValue(N value,
boolean fireEvents,
boolean redraw)
Sets this object's value and optionally redraw the widget.
|
protected boolean |
validateValue(N value) |
addTwinTriggerClickHandler
addTriggerClickHandler, isEditable, isFinishEditOnEnter, isMonitorTab, onBlur, onDetach, setEditable, setFinishEditOnEnter, setHideTrigger, setMonitorTab
addChangeHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addParseErrorHandler, clear, doAutoValidate, getCurrentValue, getCursorPos, getDirection, getDirectionEstimator, getEmptyText, getFocusEl, getImpl, getInputEl, getSelectedText, getSelectionLength, getText, getValueOrThrow, isAllowBlank, isClearValueOnParseError, isCurrentValid, isCurrentValid, isReadOnly, isSelectOnFocus, onCellParseError, onRedraw, 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, markInvalid, onBrowserEvent, onDisable, onEnable, onFocus, onKeyDown, onKeyPress, onKeyUp, onLogicalBlur, onLogicalFocus, onNavigationKey, onPropertyChange, removeValidator, reset, setAutoValidate, setDelegate, setErrors, setErrorSupport, setName, setOriginalValue, setValidateOnBlur, setValidationDelay, showErrors, validate, validate
createContext, getElement, getKey, getKeyProvider, getValue, onResize, redraw, redraw, setKeyProvider, setValue
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disable, disableContextMenu, disableEvents, enable, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onAttach, onHide, onHideContextMenu, onLoad, onPosition, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBlurHandler
protected SpinnerField.SpinnerMessages messages
public SpinnerField(NumberPropertyEditor<N> editor)
editor
- the property editor that increments, decrements and formats
the value.public SpinnerField(SpinnerFieldCell<N> cell)
cell
- a numeric cell with up / down arrows that increment / decrement
the valuepublic HandlerRegistration addBeforeSelectionHandler(<any> handler)
public HandlerRegistration addSelectionHandler(<any> handler)
public SpinnerFieldCell<N> getCell()
CellComponent
Cell
wrapped by this widget.getCell
in class TriggerField<N extends Number & Comparable<N>>
Cell
being wrappedpublic Number getIncrement(Context context)
context
- the cell contextpublic Number getMaxValue()
public SpinnerField.SpinnerMessages getMessages()
public Number getMinValue()
public NumberPropertyEditor<N> getPropertyEditor()
ValueBaseField
getPropertyEditor
in class ValueBaseField<N extends Number & Comparable<N>>
public boolean isAllowDecimals()
public boolean isAllowNegative()
public void setAllowDecimals(boolean allowDecimals)
allowDecimals
- true to allow negative valuespublic void setAllowNegative(boolean allowNegative)
allowNegative
- true to allow negative valuespublic void setIncrement(N increment)
increment
- the increment to set.public void setMaxValue(N maxValue)
maxValue
- the max valuepublic void setMessages(SpinnerField.SpinnerMessages messages)
messages
- the messagespublic void setMinValue(Number minValue)
minValue
- the minimum valuepublic void setValue(N value, boolean fireEvents, boolean redraw)
CellComponent
ValueChangeEvent
when
fireEvents is true and the new value does not equal the existing value.
Redraws the widget when redraw is true and the new value does not equal the
existing value.protected boolean validateValue(N value)
validateValue
in class Field<N extends Number & Comparable<N>>
Copyright © 2018. All rights reserved.