N
- the numeric field typepublic class SpinnerField<N extends Number> extends TwinTriggerField<N> implements HasBeforeSelectionHandlers<N>, HasSelectionHandlers<N>
NumberPropertyEditor
for number property editors you can use with
spinner field.Modifier and Type | Class and Description |
---|---|
static interface |
SpinnerField.SpinnerMessages
The locale-sensitive messages used by this class.
|
Field.FieldStyles
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasDirection.Direction
DEBUG_ID_PREFIX
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(BeforeSelectionHandler<N> handler) |
HandlerRegistration |
addSelectionHandler(SelectionHandler<N> handler) |
SpinnerFieldCell<N> |
getCell()
Get the
Cell wrapped by this widget. |
Number |
getIncrement(Cell.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.
|
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 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(BeforeSelectionHandler<N> handler)
addBeforeSelectionHandler
in interface HasBeforeSelectionHandlers<N extends Number>
public HandlerRegistration addSelectionHandler(SelectionHandler<N> handler)
addSelectionHandler
in interface HasSelectionHandlers<N extends Number>
public SpinnerFieldCell<N> getCell()
CellComponent
Cell
wrapped by this widget.getCell
in class TriggerField<N extends Number>
Cell
being wrappedpublic Number getIncrement(Cell.Context context)
public Number getMaxValue()
public SpinnerField.SpinnerMessages getMessages()
public Number getMinValue()
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 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 valueCopyright © 2015. All rights reserved.