Class NumberItem
- All Implemented Interfaces:
Animatable<NumberItem>
,CanDrop<NumberItem>
,Clickable<NumberItem>
,SupportAppend<NumberItem>
,SupportHelpIcon<NumberItem>
,SupportPlaceholder<NumberItem>
,Draggable<NumberItem>
,Editable<NumberItem>
,Focusable<NumberItem>
,HandleHotKey<NumberItem>
,HandleKeyboardEvents<NumberItem>
,HandleMouseEvents<NumberItem>
,Touchable<NumberItem>
Number item
Input field used to enter a numeric value. The component prompts the user to enter a numeric value that is either an integer or a fraction. The component displays an input field where only numeric characters are allowed. A plus and a minus icon are also displayed, used to increment or decrement the component’s value.
The minimum and maximum value for the component. In this case the user is allowed to enter a value only within the specified range, and the increment/decrement steps are specified.
The number item component is a form item which means the component can be placed on the Form
component and the form fully supports its functionality.
The component may be used as a standalone component, but in this case value and event handling must be implemented from code.
Supported events:
AnimationStart
AnimationEnd
,
Focus
FocusOut
FocusIn
LosesFocus
copy
cut
EnterPressed
input
paste
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
KeyPress
,
KeyUp
,
KeyDown
,
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
HotKey
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.components.form.FormItem
appends, clearButton, column, defaultState, defaultValue, description, formItemSize, helpIcon, label, labelPosition, labelSizes, modified, originalValue, params, prepends, required, showLabel, state, tabIndex, value, visible
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
Fields inherited from interface com.jbstrap.ui.components.form.SupportAppend
LOG
-
Constructor Summary
ConstructorDescriptionNumberItem
(DataDescriptorColumn column) Creates a numeric input field using the specified DataDescriptor column.NumberItem
(DataDescriptorColumn column, String language) Creates a numeric input field based on the specified DataDescriptor column and language code.NumberItem
(String name, String label) Creates an input field with the specified name and label.NumberItem
(String name, String label, String language) Creates a numeric input field with the specified name, label and language code. -
Method Summary
Modifier and TypeMethodDescriptionvoid
The operations to be executed after the drawing of the componentvoid
drawEditor
(StringWriter writer) Draws the editor component.int
Gets the number of decimal digits in the component.final char
Gets the decimal separator.final String
Gets the style class name for the decrement button.final Double
Gets the maximum value for the component.final Double
Gets the minimum value for the componentfinal String
Gets the postfix text to be displayed after the input box.final String
Gets the prefix text.final Number
getStep()
Gets the increment/decrement value set by the buttons.final char
Gets the decimal separator.final String
Gets the style class for the increment button.void
init()
The component initialization method.boolean
Sets if the component is enabled.final boolean
Sets if the component value is allowed to be modified using the mouse wheel.boolean
Sets if the input field is read-only.final boolean
Sets if the increment/decrement buttons are displayed on the interface.final boolean
Sets if the increment/decrement buttons are displayed below each other.final NumberItem
setDecimalPlaces
(int decimalPlaces) Sets the number of decimal digits.final NumberItem
setDecimalSeparator
(char separator) Set the decimal separator.setDefaultValue
(Object defaultValue) Sets input field default value.setEnabled
(boolean enabled) Enabling/disabling the component on the interface.final NumberItem
setMaximumValue
(Number maxValue) Sets the component’s maximum value.final NumberItem
setMinimumValue
(Number minValue) Sets the minimum value for the component.final NumberItem
setMousewheelSupport
(boolean mousewheel) Sets if mouse wheel is supported.setObjectValue
(Object value) Sets the form item’s current value using the object in the parameter.setOriginalObjectValue
(Object value) Sets the form item’s original value using the object in the parameter.final NumberItem
setOriginalValue
(Double value) Sets the original value of the componentfinal NumberItem
setPostfix
(String postfixText) Sets the postfix text to be displayed after the input box.final NumberItem
setPostfix
(String postfixText, String postfixStyleClass) Sets the postfix text and the custom style class for the postfix.final NumberItem
Sets the input box prefix.final NumberItem
Sets the input box prefix and the custom style class of the prefix box.setReadOnly
(boolean readOnly) Sets if the field is read-only.final NumberItem
setShowTouchSpin
(boolean showTouchSpin) Sets the appearance of the increment/decrement button.final NumberItem
Sets the increment/decrement value specified by the buttons.final NumberItem
setThousandsSeparator
(char separator) Sets the thousands separator for the numbers.final NumberItem
setTouchspinButtonClass
(String upButtonClass, String downButtonClass) Custom style class for the increment/decrement buttons.final NumberItem
setTouchSpinVertical
(boolean vertical) Sets the alignment of the increment/decrement buttons.final NumberItem
Sets the current value of the component.Methods inherited from class com.jbstrap.ui.components.form.FormItem
_addComponent, _setReverseShow, _setState, addComponent, addRecalcOnChangeColumn, addRecalcOnChangeColumns, addRecalcOnChangeColumns, addValueChangeHandler, clearValue, convertValueToJavaScript, convertValueToJavaScript, drawComponent, enableClearButton, eraseValue, getCalculateValue, getColumn, getComponents, getDataType, getDefaultState, getDescription, getFormItemSize, getLabel, getLabelPosition, getLabelSize, getLabelSize, getName, getOriginalValue, getParam, getParamAsBoolean, getParamAsDate, getParamAsDate, getParamAsDouble, getParamAsInteger, getParamAsLong, getParamAsNumber, getParamAsString, getRecalcOnChangeColumnsList, getState, getTabIndex, getValue, getValueAsBoolean, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsString, isAssignable, isAutoCalculate, isModified, isRequired, isReverseShow, isShowLabel, isVisible, onFormItemValueChanged, onHotKeyEventHandler, onShow, redraw, removeParam, resetState, runAfterDrawOnAddon, runOnHideOnAddon, runOnShowOnAddon, setCalculateValue, setDataType, setDataType, setDescription, setFocus, setFormItemSize, setLabel, setLabelPosition, setLabelSize, setLabelSize, setMargin, setModified, setPadding, setParam, setParams, setRequired, setShowLabel, setState, setTabIndex, setVisible, triggerFormChange, writeHTML
Methods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEventBubbling, onHide, openTag, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setName, setOverflow, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.Editable
addCopyHandler, addCutHandler, addEnterPressedHandler, addInputHandler, addPasteHandler
Methods inherited from interface com.jbstrap.ui.Focusable
addFocusHandler, addFocusInHandler, addFocusOutHandler, addLosesFocusHandler, setFocus
Methods inherited from interface com.jbstrap.ui.HandleHotKey
addHotKey, addHotKey, removeHotKey, removeHotKeys
Methods inherited from interface com.jbstrap.ui.HandleKeyboardEvents
addKeyDownHandler, addKeyPressHandler, addKeyUpHandler
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.components.form.SupportAppend
append, append, append, prepend, prepend, prepend, removeAppend, removePrepend
Methods inherited from interface com.jbstrap.ui.components.form.SupportHelpIcon
getHelpIcon, getHelpText, setHelpIcon, setHelpText
Methods inherited from interface com.jbstrap.ui.components.form.SupportPlaceholder
getPlaceholder, setPlaceholder
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
NumberItem
Creates an input field with the specified name and label.- Parameters:
name
- Input field namelabel
- Input field label. Ifnull
is set, the field has no label.- Throws:
NullPointerException
- Thrown if the name specified for the field isnull
-
NumberItem
Creates a numeric input field with the specified name, label and language code.- Parameters:
name
- Input field namelabel
- Input field label. Ifnull
is set, the field has no label.language
- The language code used to create the field If not specified or set tonull
, the field is created using the default language of the framework. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.- Throws:
NullPointerException
- Thrown if the name specified for the field isnull
-
NumberItem
Creates a numeric input field using the specified DataDescriptor column.
The method creates and sets a numeric input field based on the parameter-specified DataDescriptor column. The following parameters of the DataDescriptor are used:
DataDescriptorColumn.getTitle
- The field label is the one specified for the DataDescriptor columnDataDescriptorColumn.isNullable()
- If the field gets a value ofnull
, it is not designated as mandatory. If the field value is not set tonull
, it is designated as a mandatory field.MetaParamName.MIN_VALUE
- This parameter specifies the minimum value of the component The parameter must take a value that can be converted toLong
. If the parameter is not specified, no lower bound is set for the component value.MetaParamName.MAX_VALUE
- This parameter specifies the maximum value of the component. The parameter must take a value that can be converted toLong
. If the parameter is not specified, no lower bound is set for the component value.MetaParamName.TOUCHSPIN_STEP
- This parameter specifies the increment/decrement step. The default value is 0.1. The parameter must take a value that can be converted toLong
MetaParamName.TOUCHSPIN_BUTTONUP_CLASS
- This parameter specifies the custom CSS class for the increment buttonMetaParamName.TOUCHSPIN_BUTTONDOWN_CLASS
- This parameter specifies the custom CSS class for the decrement buttonMetaParamName.TOUCHSPIN_PREFIX
- If a text is set in the parameter, it is displayed as a prefix in front of the input field.MetaParamName.TOUCHSPIN_PREFIX_EXTRACLASS
- If a prefix is displayed in front of the input field, the custom CSS class containing the prefix is specified hereMetaParamName.TOUCHSPIN_POSTFIX
- If a text is specified in the parameter, it is displayed after the input field as a postfix.MetaParamName.TOUCHSPIN_POSTFIX_EXTRACLASS
- If a postfix comes after the input field, the CSS class for the postfix box is specified hereMetaParamName.TOUCHSPIN_VERTICALBUTTONS
- If the value is set totrue
, increment and decrement buttons are displayed below each other on the right side of the component. By default, the decrement button is displayed on the left side of the input field, whereas the increment button is displayed on the right side of the input field.MetaParamName.MOUSEWHEEL
- If the parameter is set totrue
, the user is able to change the component value by using the mouse wheel. This function is disabled by default.MetaParamName.PLACEHOLDER
- Placeholder text to be used in the input field. This text is displayed if no other text is entered into the input field.MetaParamName.SIZE
- The input field size is set from the value specified here. (Available values: SMALL, MEDIUM, LARGE)MetaParamName.STATE
- The input field state is set from these values. (Available values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE
- The value specified here is set as the input field’s default value. The value must be specified based on the field’s data type, that is, it must be a text value.MetaParamName.READ_ONLY
- Iftrue
is set, the field is created as a read-only field. Otherwise the field is created as writable and the user is free to change its content.MetaParamName.ENABLED
- Iffalse
is set, the field is disabled. Otherwise the field is created as enabled.MetaParamName.HELP
- If this parameter is specified, an icon is displayed next to the input field and the text specified here appears as a help text if the user moves the mouse over it.MetaParamName.HELP_ICON
- If an icon name is specified in the parameter, also listed in the enumIcon
, the default help text is changed to the icon.MetaParamName.DESCRIPTION
- The text specified here will appear below the field, in a smaller, italic font.MetaParamName.TAB_INDEX
- The value specified here determines the order of the input focus (when the user presses the Tab key). The smaller the value is, the sooner the field gets focus. The greater the value is, the later the field gets focus. If the parameter is not specified, the field’s tab index receives the focus order value set for the field in the DataDescriptor. If that is also not specified, the focus order is based on which data value was entered earlier into the DataDescriptor.
- Parameters:
column
- The DataDescriptor column based on which the field is created- Throws:
NullPointerException
- Thrown if the parameter’s specified column is set tonull
NumberFormatException
- Thrown if the value of the parameters MIN_VALUE, MAX_VALUE vagy a TOUCHSPIN_STEP cannot be parsed toLong
.
-
NumberItem
Creates a numeric input field based on the specified DataDescriptor column and language code.
The method creates and sets a numeric input field based on the parameter-specified DataDescriptor column. The following parameters of the DataDescriptor are used:
DataDescriptorColumn.getTitle
- The field label is the one specified for the DataDescriptor columnDataDescriptorColumn.isNullable()
- If the field gets a value ofnull
, it is not designated as mandatory. If the field value is not set tonull
, it is designated as a mandatory field.MetaParamName.MIN_VALUE
- This parameter specifies the minimum value of the component The parameter must take a value that can be converted toLong
. If the parameter is not specified, no lower bound is set for the component value.MetaParamName.MAX_VALUE
- This parameter specifies the maximum value of the component. The parameter must take a value that can be converted toLong
. If the parameter is not specified, no lower bound is set for the component value.MetaParamName.TOUCHSPIN_STEP
- This parameter specifies the increment/decrement step. The default value is 0.1. The parameter must take a value that can be converted toLong
MetaParamName.TOUCHSPIN_BUTTONUP_CLASS
- This parameter specifies the custom CSS class for the increment buttonMetaParamName.TOUCHSPIN_BUTTONDOWN_CLASS
- This parameter specifies the custom CSS class for the decrement buttonMetaParamName.TOUCHSPIN_PREFIX
- If a text is set in the parameter, it is displayed as a prefix in front of the input field.MetaParamName.TOUCHSPIN_PREFIX_EXTRACLASS
- If a prefix is displayed in front of the input field, the custom CSS class containing the prefix is specified hereMetaParamName.TOUCHSPIN_POSTFIX
- If a text is specified in the parameter, it is displayed after the input field as a postfix.MetaParamName.TOUCHSPIN_POSTFIX_EXTRACLASS
- If a postfix comes after the input field, the CSS class for the postfix box is specified hereMetaParamName.TOUCHSPIN_VERTICALBUTTONS
- If the value is set totrue
, increment and decrement buttons are displayed below each other on the right side of the component. By default, the decrement button is displayed on the left side of the input field, whereas the increment button is displayed on the right side of the input field.MetaParamName.MOUSEWHEEL
- If the parameter is set totrue
, the user is able to change the component value by using the mouse wheel. This function is disabled by default.MetaParamName.PLACEHOLDER
- Placeholder text to be used in the input field. This text is displayed if no other text is entered into the input field.MetaParamName.SIZE
- The input field size is set from the value specified here. (Available values: SMALL, MEDIUM, LARGE)MetaParamName.STATE
- The input field state is set from these values. (Available values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE
- The value specified here is set as the input field’s default value. The value must be specified based on the field’s data type, that is, it must be a text value.MetaParamName.READ_ONLY
- Iftrue
is set, the field is created as a read-only field. Otherwise the field is created as writable and the user is free to change its content.MetaParamName.ENABLED
- Iffalse
is set, the field is disabled. Otherwise the field is created as enabled.MetaParamName.HELP
- If this parameter is specified, an icon is displayed next to the input field and the text specified here appears as a help text if the user moves the mouse over it.MetaParamName.HELP_ICON
- If an icon name is specified in the parameter, also listed in the enumIcon
, the default help text is changed to the icon.MetaParamName.DESCRIPTION
- The text specified here will appear below the field, in a smaller, italic font.MetaParamName.TAB_INDEX
- The value specified here determines the order of the input focus (when the user presses the Tab key). The smaller the value is, the sooner the field gets focus. The greater the value is, the later the field gets focus. If the parameter is not specified, the field’s tab index receives the focus order value set for the field in the DataDescriptor. If that is also not specified, the focus order is based on which data value was entered earlier into the DataDescriptor.MetaParamName.SHOW_BUTTONS
- This parameter determines if the buttons are shown on the component. By default, the buttons are not shown. Iftrue
, the buttons will be displayed in the component's input field
- Parameters:
column
- The DataDescriptor column based on which the field is createdlanguage
- The language code used to create the field If not specified or set tonull
, the field is created using the default language of the framework. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.- Throws:
NullPointerException
- Thrown if the parameter’s specified column is set tonull
NumberFormatException
- Thrown if the value of the parameters MIN_VALUE, MAX_VALUE vagy a TOUCHSPIN_STEP cannot be parsed toLong
.
-
-
Method Details
-
setThousandsSeparator
Sets the thousands separator for the numbers. By default the framework’s thousands separator is used. This character is specified by the parameterJBStrapParamType.THOUSANDS_SEPARATOR
- Parameters:
separator
- Thousands separator- Returns:
- Numeric input component
-
getThousandsSeparator
public final char getThousandsSeparator()Gets the decimal separator.- Returns:
- The decimal separator
-
setDecimalSeparator
Set the decimal separator. By default the framework’s decimal separator is used. This character is specified by the parameterJBStrapParamType.DECIMAL_SEPARATOR
- Parameters:
separator
- The decimal separator- Returns:
- Numeric input component
-
getDecimalSeparator
public final char getDecimalSeparator()Gets the decimal separator.- Returns:
- The decimal separator
-
setDecimalPlaces
Sets the number of decimal digits. By default, only 2 decimal digits are displayed.- Parameters:
decimalPlaces
- The number of decimal digits to be displayed- Returns:
- Numeric input component
-
getDecimalPalces
public int getDecimalPalces()Gets the number of decimal digits in the component.- Returns:
- The number of decimal digits to be displayed
-
getMinimumValue
Gets the minimum value for the component- Returns:
- The minimum value for the component or
null
if no minimum value is set
-
setMinimumValue
Sets the minimum value for the component.- Parameters:
minValue
- The minimum value of the component No smaller value is allowed to be set for this component.- Returns:
- Numeric input component
-
getMaximumValue
Gets the maximum value for the component.- Returns:
- The maximum value for the component or
null
if the maximum value is not specified
-
setMaximumValue
Sets the component’s maximum value.- Parameters:
maxValue
- The maximum value for the component No greater value is allowed to be set for this component.- Returns:
- Numeric input component
-
setValue
Sets the current value of the component.- Overrides:
setValue
in classFormItem<Double,
NumberItem> - Parameters:
value
- The current value of the component- Returns:
- Numeric input component
-
setOriginalValue
Sets the original value of the component- Overrides:
setOriginalValue
in classFormItem<Double,
NumberItem> - Parameters:
value
- The original value of the component- Returns:
- Numeric input component
-
setObjectValue
Description copied from class:FormItem
Sets the form item’s current value using the object in the parameter.- Overrides:
setObjectValue
in classFormItem<Double,
NumberItem> - Parameters:
value
- The current value of the component- Returns:
- Numeric input component
- Throws:
NumberFormatException
- Thrown if the text equivalent of the specified value cannot be converted toLong
-
setOriginalObjectValue
Description copied from class:FormItem
Sets the form item’s original value using the object in the parameter.- Overrides:
setOriginalObjectValue
in classFormItem<Double,
NumberItem> - Parameters:
value
- The original value of the component- Returns:
- Numeric input component
- Throws:
NumberFormatException
- Thrown if the text equivalent of the specified value cannot be converted toLong
-
isShowTouchSpin
public final boolean isShowTouchSpin()Sets if the increment/decrement buttons are displayed on the interface.- Returns:
- If
true
, the increment/decrement buttons are visible, otherwisefalse
-
setShowTouchSpin
Sets the appearance of the increment/decrement button. By default, the increment/decrement buttons are hidden on the interface.- Parameters:
showTouchSpin
- Iftrue
is set, the increment/decrement buttons are visible Iffalse
is set,the increment/decrement buttons are not displayed on the interface.- Returns:
- Numeric input component
-
setStep
Sets the increment/decrement value specified by the buttons. By default, the value is incremented/decremented in a step of 1.- Parameters:
step
- Increment/decrement step- Returns:
- Numeric input component
-
getStep
Gets the increment/decrement value set by the buttons.- Returns:
- Increment/decrement step
-
setPrefix
Sets the input box prefix.- Parameters:
prefixText
- Prefix text- Returns:
- Numeric input component
-
setPrefix
Sets the input box prefix and the custom style class of the prefix box.- Parameters:
prefixText
- PrefixprefixStyleClass
- Prefix box style class- Returns:
- Numeric input component
-
getPrefix
Gets the prefix text.- Returns:
- The prefix text or
null
if no prefix is set for the component
-
setPostfix
Sets the postfix text to be displayed after the input box.- Parameters:
postfixText
- Postfix text- Returns:
- Numeric input component
-
setPostfix
Sets the postfix text and the custom style class for the postfix.- Parameters:
postfixText
- Postfix textpostfixStyleClass
- The name of the style class for the postfix box- Returns:
- Numeric input component
-
getpostfix
Gets the postfix text to be displayed after the input box.- Returns:
- Postfix text or
null
if no postfix is set for the component
-
setTouchspinButtonClass
Custom style class for the increment/decrement buttons.- Parameters:
downButtonClass
- The style class for the decrement buttonupButtonClass
- The style class for the increment button- Returns:
- Numeric input component
-
getUpButtonStyleClass
Gets the style class for the increment button.- Returns:
- The style class for the increment button or
null
if the increment button has no defined custom style class
-
getDownButtonStyleClass
Gets the style class name for the decrement button.- Returns:
- Style class name for the decrement button or
null
if the decrement button has no custom syle class defined
-
setTouchSpinVertical
Sets the alignment of the increment/decrement buttons. By default, increment/decrement buttons are located to the left and right of the input field. This settings may be changed so that buttons are below each other to the right of the input field.- Parameters:
vertical
- Iftrue
is set, increment/decrement buttons are located below each other to the right of the input field. Iffalse
is set, the increment/decrement buttons are located to the left and right of the input field.- Returns:
- Numeric input component
-
isTouchSpinVertical
public final boolean isTouchSpinVertical()Sets if the increment/decrement buttons are displayed below each other.- Returns:
- If
true
is set, increment/decrement buttons are located below each other to the left of the input field. Otherwisefalse
.
-
drawEditor
Description copied from class:FormItem
Draws the editor component.
You do not need to use this method during development, but all components extending the form item must implement it. Use the method to generate the input field’s HTML code. This code is then inserted into the corresponding DOM code when drawing the form item.
- Specified by:
drawEditor
in classFormItem<Double,
NumberItem> - Parameters:
writer
- The HTML string writer class instance; write here the HTML code for the input field
-
init
Description copied from class:Component
The component initialization method.Empty method, only needs to be overwritten when making a custom component, that needs to call an initializing JavaScript on the client side. The method is called by the framework after the component is drawn, but before the afterDraw() method. The use of this method during application development is not allowed. This method is meant for inner use only.
- Overrides:
init
in classFormItem<Double,
NumberItem> - Throws:
JavaScriptLoadError
- If there was a JavaScript error during the initialization.
-
setDefaultValue
Sets input field default value.- Specified by:
setDefaultValue
in classFormItem<Double,
NumberItem> - Parameters:
defaultValue
- The default value for the input field- Returns:
- Form item component
- Throws:
NumberFormatException
- Thrown if the specified value cannot be converted toLong
-
afterDraw
public void afterDraw()Description copied from class:Component
The operations to be executed after the drawing of the componentBy default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.
- Overrides:
afterDraw
in classFormItem<Double,
NumberItem>
-
setReadOnly
Sets if the field is read-only. If the field is set to read-only, the user is not allowed to change or modify the input field value using the increment/decrement buttons. Modifications are allowed by default.- Overrides:
setReadOnly
in classFormItem<Double,
NumberItem> - Parameters:
readOnly
- Iftrue
is set, the field is read-only, otherwise modifications are allowed- Returns:
- Numeric input component
-
isReadOnly
public boolean isReadOnly()Sets if the input field is read-only.- Overrides:
isReadOnly
in classFormItem<Double,
NumberItem> - Returns:
- If
true
is set, the input field is read-only, otherwise modifications are allowed
-
setEnabled
Enabling/disabling the component on the interface. If the component is disabled, the user is not allowed to use it and change its value. By default the component is enabled.- Overrides:
setEnabled
in classFormItem<Double,
NumberItem> - Parameters:
enabled
- Iftrue
is set, the component is enabled, otherwise disabled- Returns:
- Numeric input component
-
isEnabled
public boolean isEnabled()Sets if the component is enabled.- Overrides:
isEnabled
in classComponent<NumberItem>
- Returns:
- If
true
is set, the component is enabled, otherwise disabled
-
setMousewheelSupport
Sets if mouse wheel is supported. If the mouse wheel is supported, the input box value can be incremented/decremented using the mouse wheel. This function is disabled by default.- Parameters:
mousewheel
- Iftrue
is set, the mouse wheel can be used to increment/decrement component value, otherwise not.- Returns:
- Numeric input component
-
isMousewhelSupport
public final boolean isMousewhelSupport()Sets if the component value is allowed to be modified using the mouse wheel.- Returns:
- If
true
the component value can be modified using the mouse wheel, otherwise not.
-