T - The type of the class extending from this base classE - The Numeric type of the component valuepublic abstract class NumberBox<T extends NumberBox<T,E>,E extends Number> extends AbstractValueBox<T,elemental2.dom.HTMLInputElement,E>
ValueBox.AutoValidate, ValueBox.AutoValidatorBasicFormElement.FieldHandler<T>BaseDominoElement.ElementHandler<T>, BaseDominoElement.ResizeHandler<T>, BaseDominoElement.StyleEditor<E extends elemental2.dom.HTMLElement,T extends org.jboss.elemento.IsElement<E>>, BaseDominoElement.WavesStylerHasChangeHandlers.ChangeHandler<V>HasValidation.ValidatorchangeHandlers, changeListener, DISABLED, fieldContainer, fieldGroup, FLOATING, FOCUSED, inputContainer, inputListenerelement| Constructor and Description |
|---|
NumberBox(String label)
Create an instance with a label
|
| Modifier and Type | Method and Description |
|---|---|
protected ValueBox.AutoValidator |
createAutoValidator(ValueBox.AutoValidate autoValidate)
Create an AutoValidator that will automatically validate the component when it loses focus
|
protected elemental2.dom.HTMLInputElement |
createInputElement(String type)
Creates an input element with the specified type
|
protected String |
createKeyMatch() |
protected abstract E |
defaultMaxValue() |
protected abstract E |
defaultMinValue() |
protected abstract Function<String,E> |
defaultValueParser() |
T |
disableFormatting()
Disable auto formatting the field value to match the pattern specified by
setPattern(String) |
protected void |
doSetValue(E value) |
T |
enableFormatting()
Enables auto formatting the field value to match the pattern specified by
setPattern(String) |
String |
getInvalidFormatMessage() |
E |
getMaxValue() |
String |
getMaxValueErrorMessage() |
E |
getMinValue() |
String |
getMinValueErrorMessage() |
protected org.gwtproject.i18n.client.NumberFormat |
getNumberFormat() |
String |
getPattern() |
E |
getStep() |
String |
getStringValue() |
E |
getValue() |
protected boolean |
hasDecimalSeparator() |
boolean |
isEmpty() |
boolean |
isEmptyIgnoreSpaces() |
protected abstract boolean |
isExceedMaxValue(E maxValue,
E value)
Checks if a a given value is actually greater than the maximum allowed value
|
protected abstract boolean |
isLowerThanMinValue(E minValue,
E value)
Checks if a a given value is actually less than the minimum allowed value
|
protected void |
onKeyPress(elemental2.dom.Event event) |
protected void |
onPaste(elemental2.dom.Event event) |
double |
parseDouble(String value) |
protected E |
parseValue(String value)
Reads a String value and convert it to the field number type
|
T |
setInvalidFormatMessage(String invalidFormatMessage) |
T |
setMaxValue(E maxValue)
Sets the maximum allowed value for the field
|
T |
setMaxValueErrorMessage(String maxValueErrorMessage) |
T |
setMinValue(E minValue)
Sets the minimum allowed value for the field
|
T |
setMinValueErrorMessage(String minValueErrorMessage) |
T |
setPattern(String pattern) |
T |
setStep(E step)
Sets the increment step attribute for the field
|
T |
setValueParser(Function<String,E> valueParser) |
getMaxLength, getMinLength, getMinLengthErrorMessage, setMaxLength, setMinLength, setMinLengthErrorMessage, setReadOnly, updateCharacterCount, valueaddChangeHandler, addLeftAddOn, addLeftAddOn, addLeftAddOn, addOnClearHandler, addRightAddOn, addRightAddOn, addRightAddOn, allowEmptyLabel, asTableField, autoValidate, callChangeHandlers, changeLabelFloating, clear, clear, clearInvalid, clearValue, clearValue, condense, createLabelElement, createMandatoryAddOn, disable, doFocus, doUnfocus, element, enable, floating, floatLabel, focus, getAdditionalInfoContainer, getCountItem, getErrorItem, getErrorsContainer, getFieldContainer, getFieldGroup, getFieldInputContainer, getFieldStyle, getFocusColor, getHelperContainer, getHelpItem, getInputContainer, getInputElement, getLabelElement, getLabelTextElement, getLeftAddonContainer, getLeftAddOnsContainer, getMandatoryAddOn, getNotesContainer, getOnClearHandlers, getPlaceholder, getPostfix, getPostFixItem, getPrefix, getPrefixItem, getRightAddonContainer, getRightAddOnsContainer, hasChangeHandler, hideLabelText, hidePlaceholder, invalidate, invalidate, isAddFocusColor, isAutoValidation, isFloating, isFocused, isReadOnly, linkLabelToField, nonfloating, onEnterKey, pauseChangeHandlers, pauseFocusValidation, removeChangeHandler, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOns, removeOnClearHandler, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOns, resumeChangeHandlers, resumeFocusValidation, setAutoValidation, setFieldStyle, setFixErrorsPosition, setFloating, setFocusColor, setLabel, setLabel, setLabel, setLabel, setLabelTextVisible, setPauseChangeHandlers, setPlaceholder, setPostFix, setPrefix, setSpellCheck, setTableField, shouldShowPlaceholder, showLabelText, showPlaceholder, spread, unfloatLabel, unfocus, updateLabel, valueaddValidator, getErrorLabels, getErrors, getHelperText, getLabel, getName, getRequiredErrorMessage, groupBy, hasValidator, isDisabled, isEnabled, isFixErrorsPosition, isRequired, isShowRequiredIndicator, isValidationDisabled, makeErrorLabel, removeValidator, setHelperText, setName, setRequired, setRequired, setRequiredErrorMessage, setShowRequiredIndicator, setValidationDisabled, setValue, showErrors, ungroup, validate, withValidationDisabledadd, add, addClickListener, addCss, addCss, addEventListener, addEventListener, addEventsListener, addHideListener, addShowListener, alignCenter, alignRight, appendChild, appendChild, apply, attr, blur, childNodes, clearElement, contains, contains, contains, containsCss, css, css, cssClassByIndex, cssClassesCount, cssText, elevate, elevate, firstChild, getAttachObserver, getAttribute, getBoundingClientRect, getChildElementCount, getClickableElement, getCollapsible, getCollapsibleElement, getDetachObserver, getDominoId, getElementsCount, getElevation, getFirstChild, getId, getTextContent, getTooltip, getWavesElement, hasAttribute, hasChildNodes, hasDirectChild, hide, hideOn, id, init, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, insertFirst, insertFirst, insertFirst, isAttached, isCollapsed, isEmptyElement, isEqualNode, isForceHidden, isHidden, item, lastChild, length, onAttached, onDetached, onResize, pullLeft, pullRight, querySelector, querySelectorAll, remove, removeAttachObserver, removeAttribute, removeChild, removeChild, removeCss, removeCss, removeCssProperty, removeDetachObserver, removeEventListener, removeEventListener, removeHideListener, removeHideOn, removeShowListener, removeShowOn, removeTooltip, removeWaves, replaceCss, setAlignItems, setAttribute, setAttribute, setAttribute, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBottom, setBottom, setBoxShadow, setCollapseStrategy, setColor, setColor, setContent, setContent, setCssProperty, setCssProperty, setCursor, setCursor, setDisabled, setDisplay, setDisplay, setDropMenu, setFlex, setFloat, setFloat, setFontSize, setFontSize, setForceHidden, setHeight, setHeight, setId, setInnerHtml, setLeft, setLeft, setLineHeight, setLineHeight, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setOpacity, setOpacity, setOverFlow, setOverFlow, setOverFlowY, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPointerEvents, setPosition, setPosition, setRight, setRight, setTabIndex, setTextAlign, setTextAlign, setTextContent, setTooltip, setTooltip, setTooltip, setTooltip, setTop, setTop, setTransitionDuration, setWidth, setWidth, setZIndex, show, showOn, style, style, styler, textContent, toggleDisplay, toggleDisplay, withWaves, withWavesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateAllisExpandedadd, add, remove, remove, removeProperty, replace, setProperty, setPropertypublic NumberBox(String label)
label - Stringprotected boolean hasDecimalSeparator()
protected String createKeyMatch()
protected void onKeyPress(elemental2.dom.Event event)
protected void onPaste(elemental2.dom.Event event)
protected elemental2.dom.HTMLInputElement createInputElement(String type)
protected void doSetValue(E value)
public E getValue()
getValue in interface org.gwtproject.editor.client.LeafValueEditor<E extends Number>getValue in interface org.gwtproject.editor.client.TakesValue<E extends Number>getValue in class ValueBox<T extends NumberBox<T,E>,elemental2.dom.HTMLInputElement,E extends Number>public boolean isEmpty()
public boolean isEmptyIgnoreSpaces()
isEmptyIgnoreSpaces in interface HasGrouping<T extends NumberBox<T,E>>isEmptyIgnoreSpaces in class AbstractValueBox<T extends NumberBox<T,E>,elemental2.dom.HTMLInputElement,E extends Number>public String getStringValue()
getStringValue in interface HasInputElementgetStringValue in class ValueBox<T extends NumberBox<T,E>,elemental2.dom.HTMLInputElement,E extends Number>public T setMinValue(E minValue)
minValue - E minimum valuepublic T setMaxValue(E maxValue)
maxValue - E maximum valuepublic T setStep(E step)
step - E numeric valuepublic E getMaxValue()
public E getMinValue()
public E getStep()
setStep(Number)public T setMaxValueErrorMessage(String maxValueErrorMessage)
maxValueErrorMessage - String error message to display when the field value is greater
than the maximum valuepublic T setMinValueErrorMessage(String minValueErrorMessage)
minValueErrorMessage - String error message to display when the field value is less than
the minimum valuepublic T setInvalidFormatMessage(String invalidFormatMessage)
invalidFormatMessage - String error message to display when the field value does not match
the field formatpublic String getMaxValueErrorMessage()
public String getMinValueErrorMessage()
public String getInvalidFormatMessage()
public T enableFormatting()
setPattern(String)public T disableFormatting()
setPattern(String)protected org.gwtproject.i18n.client.NumberFormat getNumberFormat()
NumberFormat instance that should be used to format this fieldpublic String getPattern()
public T setPattern(String pattern)
pattern - String pattern to format the field valuepublic double parseDouble(String value)
protected E parseValue(String value)
value - String numeric valueprotected abstract E defaultMaxValue()
setMaxValue(Number) is not calledprotected abstract E defaultMinValue()
setMinValue(Number) is not calledprotected abstract boolean isExceedMaxValue(E maxValue, E value)
maxValue - E numeric valuevalue - E numeric valueprotected abstract boolean isLowerThanMinValue(E minValue, E value)
minValue - E numeric valuevalue - E numeric valueprotected ValueBox.AutoValidator createAutoValidator(ValueBox.AutoValidate autoValidate)
createAutoValidator in class ValueBox<T extends NumberBox<T,E>,elemental2.dom.HTMLInputElement,E extends Number>autoValidate - ValueBox.AutoValidateCopyright © 2019–2022 Dominokit. All rights reserved.