Class IntegerField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,T>
com.vaadin.flow.component.AbstractSinglePropertyField<TComponent,TValue>
com.vaadin.flow.component.textfield.TextFieldBase<C,T>
com.vaadin.flow.component.textfield.AbstractNumberField<IntegerField,Integer>
com.vaadin.flow.component.textfield.IntegerField
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<IntegerField>,com.vaadin.flow.component.CompositionNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<IntegerField>,com.vaadin.flow.component.FocusNotifier<IntegerField>,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasPlaceholder,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField,,Integer>, Integer> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField,,Integer>, Integer> com.vaadin.flow.component.InputNotifier,com.vaadin.flow.component.KeyNotifier,HasClearButton,HasClientValidation,HasPrefix,HasSuffix,HasThemeVariant<TextFieldVariant>,HasTooltip,HasValidationProperties,InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField,,Integer>, Integer> HasAutocapitalize,HasAutocomplete,HasAutocorrect,HasPrefixAndSuffix,com.vaadin.flow.data.binder.HasValidator<Integer>,com.vaadin.flow.data.value.HasValueChangeMode,Serializable
@Tag("vaadin-integer-field")
@NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.4.5") @NpmPackage(value="@vaadin/integer-field",version="24.4.5")
@JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/integer-field/src/vaadin-integer-field.js")
public class IntegerField
extends AbstractNumberField<IntegerField,Integer>
implements HasThemeVariant<TextFieldVariant>
IntegerField is an extension of Text Field that only accepts integer numbers.
- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.shared.HasClientValidation
HasClientValidation.ClientValidatedEventNested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Field Summary
Fields inherited from interface com.vaadin.flow.component.textfield.HasAutocapitalize
AUTOCAPITALIZE_ATTRIBUTEFields inherited from interface com.vaadin.flow.component.textfield.HasAutocomplete
AUTOCOMPLETE_ATTRIBUTEFields inherited from interface com.vaadin.flow.component.textfield.HasAutocorrect
AUTOCORRECT_ATTRIBUTEFields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode
DEFAULT_CHANGE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyIntegerField.IntegerField(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs an emptyIntegerFieldwith a value change listener.IntegerField(String label) Constructs an emptyIntegerFieldwith the given label.IntegerField(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs an emptyIntegerFieldwith a value change listener and a label.IntegerField(String label, Integer initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs aIntegerFieldwith a value change listener, a label and an initial value.IntegerField(String label, String placeholder) Constructs an emptyIntegerFieldwith the given label and placeholder text. -
Method Summary
Modifier and TypeMethodDescriptionintgetMax()Gets the maximum allowed value of the field.intgetMin()Gets the minimum allowed value of the field.intgetStep()Gets the allowed number intervals of the field.voidsetMax(int max) Sets the maximum value of the field.voidsetMin(int min) Sets the minimum value of the field.voidsetStep(int step) Sets the allowed number intervals of the field.Methods inherited from class com.vaadin.flow.component.textfield.AbstractNumberField
addValidationStatusChangeListener, getDefaultValidator, getEmptyValue, getMaxDouble, getMinDouble, getStepDouble, getValue, isStepButtonsVisible, onAttach, setManualValidation, setMax, setMin, setModelValue, setRequiredIndicatorVisible, setStep, setStepButtonsVisible, setValue, setValueChangeMode, validateMethods inherited from class com.vaadin.flow.component.textfield.TextFieldBase
addToInput, addToPrefix, addToSuffix, getAriaLabel, getAriaLabelledBy, getTitle, getValueChangeMode, getValueChangeTimeout, isAutofocus, isAutoselect, isRequired, setAriaLabel, setAriaLabelledBy, setAutofocus, setAutoselect, setLabel, setRequired, setTitle, setValueChangeTimeoutMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, isEmpty, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.CompositionNotifier
addCompositionEndListener, addCompositionStartListener, addCompositionUpdateListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.textfield.HasAutocapitalize
getAutocapitalize, setAutocapitalizeMethods inherited from interface com.vaadin.flow.component.textfield.HasAutocomplete
getAutocomplete, setAutocompleteMethods inherited from interface com.vaadin.flow.component.textfield.HasAutocorrect
isAutocorrect, setAutocorrectMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
isClearButtonVisible, setClearButtonVisibleMethods inherited from interface com.vaadin.flow.component.shared.HasClientValidation
addClientValidatedEventListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabelMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholder, setPlaceholderMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasSuffix
getSuffixComponent, setSuffixComponentMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getOptionalValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnlyMethods inherited from interface com.vaadin.flow.component.InputNotifier
addInputListenerMethods inherited from interface com.vaadin.flow.component.KeyNotifier
addKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
-
Constructor Details
-
IntegerField
public IntegerField()Constructs an emptyIntegerField. -
IntegerField
Constructs an emptyIntegerFieldwith the given label.- Parameters:
label- the text to set as the label
-
IntegerField
Constructs an emptyIntegerFieldwith the given label and placeholder text.- Parameters:
label- the text to set as the labelplaceholder- the placeholder text to set
-
IntegerField
public IntegerField(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs an emptyIntegerFieldwith a value change listener.- Parameters:
listener- the value change listener- See Also:
-
AbstractField.addValueChangeListener(ValueChangeListener)
-
IntegerField
public IntegerField(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs an emptyIntegerFieldwith a value change listener and a label.- Parameters:
label- the text to set as the labellistener- the value change listener- See Also:
-
TextFieldBase.setLabel(String)AbstractField.addValueChangeListener(ValueChangeListener)
-
IntegerField
public IntegerField(String label, Integer initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerField, Integer>> listener) Constructs aIntegerFieldwith a value change listener, a label and an initial value.- Parameters:
label- the text to set as the labelinitialValue- the initial valuelistener- the value change listener- See Also:
-
TextFieldBase.setLabel(String)AbstractField.setValue(Object)AbstractField.addValueChangeListener(ValueChangeListener)
-
-
Method Details
-
setMin
public void setMin(int min) Sets the minimum value of the field. Entering a value which is smaller thanmininvalidates the field.- Parameters:
min- the min value to set
-
getMin
public int getMin()Gets the minimum allowed value of the field.- Returns:
- the min property of the field
- See Also:
-
setMax
public void setMax(int max) Sets the maximum value of the field. Entering a value which is greater thanmaxinvalidates the field.- Parameters:
max- the max value to set
-
getMax
public int getMax()Gets the maximum allowed value of the field.- Returns:
- the max property of the field
- See Also:
-
setStep
public void setStep(int step) Sets the allowed number intervals of the field. This specifies how much the value will be increased/decreased when clicking on thestep buttons. It is also used to invalidate the field, if the value doesn't align with the specified step andmin(if specified by user).- Parameters:
step- the new step to set- Throws:
IllegalArgumentException- if the argument is less or equal to zero.
-
getStep
public int getStep()Gets the allowed number intervals of the field.- Returns:
- the step property of the field
- See Also:
-