Class WAbstractSpinBox
- Direct Known Subclasses:
WDoubleSpinBox,WSpinBox
Although the element can be rendered using a native HTML5 control, by default it is rendered using an HTML4 compatibility workaround which is implemented using JavaScript and CSS, as most browsers do not yet implement the HTML5 native element.
-
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_, noDefaultFields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedWAbstractSpinBox(WContainerWidget parentContainer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected intboxPadding(Orientation orientation) Returns the widget's built-in padding.Returns the prefix.Returns the suffix.protected abstract Stringprotected abstract WValidator.ResultbooleanReturns whether a native HTML5 control is used.voidrefresh()Refresh the widget.protected voidrender(EnumSet<RenderFlag> flags) Renders the widget.protected voidsetFormData(WObject.FormData formData) voidsetNativeControl(boolean nativeControl) Configures whether a native HTML5 control should be used.voidsetPrefix(CharSequence prefix) Sets a prefix.voidsetSuffix(CharSequence suffix) Sets a suffix.voidSets the content of the line edit.validate()Validates the field.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, textInputMethods 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, validatorChangedMethods 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, unsetDraggableMethods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, formDataChanged, 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, resendFormData, 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, widgetRemovedMethods 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, trMethods inherited from class eu.webtoolkit.jwt.WObject
getObjectName
-
Constructor Details
-
WAbstractSpinBox
Constructor. -
WAbstractSpinBox
protected WAbstractSpinBox()Constructor.
-
-
Method Details
-
setNativeControl
public void setNativeControl(boolean nativeControl) Configures whether a native HTML5 control should be used.When
native, the new "number" input element, specified by HTML5 and when implemented by the browser, is used rather than the built-in element. The native control is styled by the browser (usually in sync with the OS) rather than through the theme chosen.The default is
false(as native support is now well implemented). -
isNativeControl
public boolean isNativeControl()Returns whether a native HTML5 control is used.Taking into account the preference for a native control, configured using
setNativeControl(), this method returns whether a native control is actually being used. -
setPrefix
Sets a prefix.Option to set a prefix string shown in front of the value, e.g.:
spinBox.setPrefix("$ ");The default prefix is empty.
Note: Not supported by the native controls.
-
getPrefix
Returns the prefix.- See Also:
-
setSuffix
Sets a suffix.Option to set a suffix string shown to the right of the value, e.g.:
spinBox.setSuffix(" crates");The default suffix is empty.
Note: Not supported by the native controls.
-
getSuffix
Returns the suffix.- See Also:
-
setText
Description copied from class:WLineEditSets the content of the line edit.The default value is "".
-
validate
Description copied from class:WFormWidgetValidates the field. -
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 classWFormWidget
-
jsValueChanged
-
render
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.
-
setFormData
- Overrides:
setFormDatain classWLineEdit
-
getTextFromValue
-
getValidateRange
-
boxPadding
Description copied from class:WWidgetReturns the widget's built-in padding.This is used by the layout managers to correct for a built-in padding which interferes with setting a widget's width (or height) to 100%.
A layout manager needs to set the width to 100% only for form widgets (
WTextArea,WLineEdit,WComboBox, etc...). Therefore, only for those widgets this needs to return the padding (the default implementation returns 0).For form widgets, the padding depends on the specific browser/platform combination, unless an explicit padding is set for the widget.
When setting an explicit padding for the widget using a style class, you will want to reimplement this method to return this padding in case you want to set the widget inside a layout manager.
- Overrides:
boxPaddingin classWLineEdit- See Also:
-