|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
eu.webtoolkit.jwt.WFormWidget
eu.webtoolkit.jwt.WLineEdit
eu.webtoolkit.jwt.WAbstractSpinBox
public abstract class WAbstractSpinBox
An abstract spin box.
Using HTML4, the widget is implemented using a <input
type="text"> The element can be styled using the
Wt-spinbox style. It may be styled through the current theme, or
you can override the style using internal or external CSS as appropriate.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WLineEdit |
|---|
WLineEdit.EchoMode |
| Constructor Summary | |
|---|---|
protected |
WAbstractSpinBox()
Constructor. |
protected |
WAbstractSpinBox(WContainerWidget parent)
Constructor. |
| Method Summary | |
|---|---|
protected int |
boxPadding(Orientation orientation)
Returns the widget's built-in padding. |
WString |
getPrefix()
Returns the prefix. |
WString |
getSuffix()
Returns the suffix. |
boolean |
isNativeControl()
Returns whether a native HTML5 control is used. |
protected void |
render(java.util.EnumSet<RenderFlag> flags)
|
void |
setNativeControl(boolean nativeControl)
Configures whether a native HTML5 control should be used. |
void |
setPrefix(java.lang.CharSequence prefix)
Sets a prefix. |
void |
setSuffix(java.lang.CharSequence suffix)
Sets a suffix. |
void |
setText(java.lang.String text)
Sets the content of the line edit. |
| Methods inherited from class eu.webtoolkit.jwt.WLineEdit |
|---|
boxBorder, getCursorPosition, getEchoMode, getMaxLength, getSelectedText, getSelectionStart, getText, getTextSize, getValueText, hasSelectedText, setEchoMode, setMaxLength, setTextSize, setValueText |
| Methods inherited from class eu.webtoolkit.jwt.WFormWidget |
|---|
blurred, changed, enableAjax, focussed, getEmptyText, getLabel, getTabIndex, getValidator, hasFocus, isReadOnly, propagateSetEnabled, refresh, remove, selected, setEmptyText, setEnabled, setFocus, setFocus, setHidden, setReadOnly, setTabIndex, setValidator, validate, validated |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, 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 |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected WAbstractSpinBox(WContainerWidget parent)
protected WAbstractSpinBox()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void setNativeControl(boolean nativeControl)
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).
public boolean isNativeControl()
Taking into account the preference for a native control, configured using
setNativeControl(), this method returns whether a native control is
actually being used.
public void setPrefix(java.lang.CharSequence 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.
public WString getPrefix()
setPrefix(CharSequence prefix)public void setSuffix(java.lang.CharSequence 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.
public WString getSuffix()
setSuffix(CharSequence suffix)public void setText(java.lang.String text)
WLineEditThe default value is "".
setText in class WLineEditWLineEdit.getText()protected void render(java.util.EnumSet<RenderFlag> flags)
render in class WFormWidgetprotected int boxPadding(Orientation orientation)
WWidgetThis 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.
boxPadding in class WLineEditWWidget.boxBorder(Orientation orientation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||