Class WDoubleSpinBox
- java.lang.Object
-
public class WDoubleSpinBox extends WAbstractSpinBox
An input control for fixed point numbers.The spin box provides a control for entering a fixed point number. It consists of a line edit, and buttons which allow to increase or decrease the value. If you rather need input of an integer number number, use
WSpinBoxinstead.WDoubleSpinBox is an
inlinewidget.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WDoubleSpinBox()Creates a spin-box.WDoubleSpinBox(WContainerWidget parentContainer)Creates a spin-box.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMaximum()Returns the maximum value.doublegetMinimum()Returns the minimum value.doublegetSingleStep()Returns the step value.protected java.lang.StringgetTextFromValue()protected WValidator.ResultgetValidateRange()doublegetValue()Returns the value.voidrefresh()Refresh the widget.protected voidrender(java.util.EnumSet<RenderFlag> flags)Renders the widget.voidsetDecimals(int decimals)Sets the precision.voidsetMaximum(double maximum)Sets the maximum value.voidsetMinimum(double minimum)Sets the minimum value.voidsetRange(double minimum, double maximum)Sets the range.voidsetSingleStep(double step)Sets the step value.voidsetValue(double value)Sets the value.Signal1<java.lang.Double>valueChanged()A signal that indicates when the value has changed.-
Methods inherited from class eu.webtoolkit.jwt.WAbstractSpinBox
boxPadding, getPrefix, getSuffix, isNativeControl, jsValueChanged, setFormData, setNativeControl, setPrefix, setSuffix, setText, validate
-
Methods inherited from class eu.webtoolkit.jwt.WLineEdit
boxBorder, getAutoCompleteToken, getCursorPosition, getDisplayText, getDomChanges, getEchoMode, getInputMask, getInputMode, getMaxLength, getSelectedText, getSelectionStart, getText, getTextSize, getType, getValueText, hasSelectedText, isAutoComplete, setAutoComplete, setAutoComplete, setEchoMode, setInputMask, setInputMask, setInputMask, setInputMask, setInputMode, setMaxLength, setSelection, setTextSize, setValueText, textInput
-
Methods inherited from class eu.webtoolkit.jwt.WFormWidget
changed, enableAjax, getLabel, getPlaceholderText, getRealValidator, getTabIndex, getValidator, hasValidatorChanged, isCanReceiveFocus, isReadOnly, propagateSetEnabled, remove, setEnabled, setHidden, setPlaceholderText, setReadOnly, setToolTip, setValidator, validated, validatorChanged
-
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
-
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
-
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
-
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName
-
-
-
-
Constructor Detail
-
WDoubleSpinBox
public WDoubleSpinBox(WContainerWidget parentContainer)
Creates a spin-box.The range is (0.0 - 99.99), the step size 1.0, and the spin box has a precision of 2 decimals.
The initial value is 0.0.
-
WDoubleSpinBox
public WDoubleSpinBox()
Creates a spin-box.
-
-
Method Detail
-
setMinimum
public void setMinimum(double minimum)
Sets the minimum value.The default value is 0.0.
-
getMinimum
public double getMinimum()
Returns the minimum value.- See Also:
setMinimum(double minimum)
-
setMaximum
public void setMaximum(double maximum)
Sets the maximum value.The default value is 99.99.
-
getMaximum
public double getMaximum()
Returns the maximum value.- See Also:
setMaximum(double maximum)
-
setRange
public void setRange(double minimum, double maximum)Sets the range.
-
setSingleStep
public void setSingleStep(double step)
Sets the step value.The default value is 1.0.
-
getSingleStep
public double getSingleStep()
Returns the step value.- See Also:
setSingleStep(double step)
-
setDecimals
public void setDecimals(int decimals)
Sets the precision.This sets the number of digits after the decimal point shown
The default precision is 2.
-
setValue
public void setValue(double value)
Sets the value.valuemust be a value betweengetMinimum()andgetMaximum().The default value is 0
-
getValue
public double getValue()
Returns the value.Note: This value may not correctly reflect the
WLineEdit.getValueText()of the spin box ifWLineEdit.getValueText()is empty or if the contents are not in avalid state.
-
valueChanged
public Signal1<java.lang.Double> valueChanged()
A signal that indicates when the value has changed.This signal is emitted when
WFormWidget.changed()is emitted, but supplies the new value as an argument. TheWFormWidget.changed()signal is emitted when the user changes the value of the spinbox by pressing the up/down arrow, or entering a different value and pressing enter or moving focus.- See Also:
WFormWidget.changed()
-
refresh
public void refresh()
Description copied from class:WWidgetRefresh the widget.The refresh method is invoked when the locale is changed using
WApplication#setLocale()or when the user hit the refresh button.The widget must actualize its contents in response.
Note: This does not rerender the widget! Calling
refresh()usually does not have any effect (unless you've reimplementedrefresh()to attach to it an effect).- Overrides:
refreshin classWAbstractSpinBox
-
render
protected void render(java.util.EnumSet<RenderFlag> flags)
Description copied from class:WWidgetRenders the widget.This function renders the widget (or an update for the widget), after this has been scheduled using
scheduleRender().The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.
- Overrides:
renderin classWAbstractSpinBox
-
getTextFromValue
protected java.lang.String getTextFromValue()
- Specified by:
getTextFromValuein classWAbstractSpinBox
-
getValidateRange
protected WValidator.Result getValidateRange()
- Specified by:
getValidateRangein classWAbstractSpinBox
-
-