Class LongField

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<LongField, Long>
com.vaadin.flow.component.AbstractSinglePropertyField<LongField, Long>
com.vaadin.flow.component.textfield.TextFieldBase<LongField, Long>
com.vaadin.flow.component.textfield.AbstractNumberField<LongField, Long>
com.vaadin.swingbridge.surrogates.LongField
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<LongField>, com.vaadin.flow.component.CompositionNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<LongField>, com.vaadin.flow.component.FocusNotifier<LongField>, com.vaadin.flow.component.HasAriaDescription, 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.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<LongField, Long>, Long>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<LongField, Long>, Long>, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<LongField, Long>, Long>, com.vaadin.flow.component.textfield.HasAutocapitalize, com.vaadin.flow.component.textfield.HasAutocomplete, com.vaadin.flow.component.textfield.HasAutocorrect, com.vaadin.flow.data.binder.HasValidator<Long>, com.vaadin.flow.data.value.HasValueChangeMode, Serializable
Direct Known Subclasses:
SJFormattedLongField

@Tag("vaadin-integer-field") @NpmPackage(value="@vaadin/integer-field", version="25.3.0") @JsModule("@vaadin/integer-field/src/vaadin-integer-field.js") public class LongField extends com.vaadin.flow.component.textfield.AbstractNumberField<LongField, Long>
Long-valued sibling of Vaadin's IntegerField. Extends AbstractNumberField with a Long type parameter and a Long.parseLong(String, int) parser; shares the vaadin-integer-field web component so the client side still rejects decimals and shows the familiar spinner-arrow chrome.

Lives in :surrogates as a plain Vaadin component — no Swing surface, no mixin. Introduced to back SJSpinner when the installed SpinnerNumberModel carries a Long value without falling back to NumberField's double-mantissa rounding, but general-purpose: any Vaadin code needing a long-typed numeric field can use it directly.

Client-side precision: values up to 253 round-trip exactly through the browser's native numeric input (JS numbers are IEEE-754 doubles; integer-valued doubles stay exact up to 253). Longs outside that range display with mantissa rounding on the wire, but the server-side parser (unchanged Long.parseLong(String, int) on the string form delivered via _inputElementValue) sees the exact text the browser rendered, so round-trip precision depends on how browsers format long integers — which today is exact for all values the browser accepts via input[type=number].

Absolute min/max passed to the superclass use Long.MIN_VALUE / Long.MAX_VALUE cast to double (precision-lossy at the extremes, but the superclass removes those properties from the DOM immediately after initialisation — they only matter as signal defaults until a caller explicitly setMin / setMax).

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

    com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,V>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E>
  • Field Summary

    Fields inherited from interface com.vaadin.flow.component.textfield.HasAutocapitalize

    AUTOCAPITALIZE_ATTRIBUTE

    Fields inherited from interface com.vaadin.flow.component.textfield.HasAutocomplete

    AUTOCOMPLETE_ATTRIBUTE

    Fields inherited from interface com.vaadin.flow.component.textfield.HasAutocorrect

    AUTOCORRECT_ATTRIBUTE

    Fields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode

    DEFAULT_CHANGE_TIMEOUT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    long
     
    long
     
    void
    setMax(long max)
     
    void
    setMin(long min)
    Sets the minimum value for the field.
    void
    setStep(long step)
    Sets the spinner-arrow step.

    Methods inherited from class com.vaadin.flow.component.textfield.AbstractNumberField

    addValidationStatusChangeListener, bindMaxInternal, bindMinInternal, getDefaultValidator, getEmptyValue, getI18n, getMaxDouble, getMinDouble, getStepDouble, getValue, isStepButtonsVisible, setI18n, setManualValidation, setMax, setMin, setModelValue, setStep, setStepButtonsVisible, setValue, setValueChangeMode, validate

    Methods inherited from class com.vaadin.flow.component.textfield.TextFieldBase

    addToInput, addToPrefix, addToSuffix, getAriaDescribedBy, getAriaLabel, getAriaLabelledBy, getTitle, getValueChangeMode, getValueChangeTimeout, isAutofocus, isAutoselect, isRequired, isRequiredIndicatorVisible, setAriaDescribedBy, setAriaLabel, setAriaLabelledBy, setAutofocus, setAutoselect, setLabel, setRequired, setRequiredIndicatorVisible, setTitle, setValueChangeTimeout

    Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField

    getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent

    Methods inherited from class com.vaadin.flow.component.AbstractField

    addValueChangeListener, bindValue, isEmpty, valueEquals

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttached

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.CompositionNotifier

    addCompositionEndListener, addCompositionStartListener, addCompositionUpdateListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasAriaDescription

    setAriaDescribedBy

    Methods inherited from interface com.vaadin.flow.component.HasAriaLabel

    setAriaLabelledBy

    Methods inherited from interface com.vaadin.flow.component.textfield.HasAutocapitalize

    getAutocapitalize, setAutocapitalize

    Methods inherited from interface com.vaadin.flow.component.textfield.HasAutocomplete

    getAutocomplete, setAutocomplete

    Methods inherited from interface com.vaadin.flow.component.textfield.HasAutocorrect

    isAutocorrect, setAutocorrect

    Methods inherited from interface com.vaadin.flow.component.shared.HasClearButton

    bindClearButtonVisible, isClearButtonVisible, setClearButtonVisible

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasHelper

    bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperText

    Methods inherited from interface com.vaadin.flow.component.HasLabel

    getLabel

    Methods inherited from interface com.vaadin.flow.component.HasPlaceholder

    bindPlaceholder, getPlaceholder, setPlaceholder

    Methods inherited from interface com.vaadin.flow.component.shared.HasPrefix

    getPrefixComponent, setPrefixComponent

    Methods inherited from interface com.vaadin.flow.component.HasSize

    bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.shared.HasSuffix

    getSuffixComponent, setSuffixComponent

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipMarkdown, setTooltipText

    Methods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties

    getErrorMessage, isInvalid, setErrorMessage, setInvalid

    Methods inherited from interface com.vaadin.flow.component.HasValue

    addValueChangeListener, bindValue, clear, getOptionalValue, isEmpty

    Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

    bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, setReadOnly

    Methods inherited from interface com.vaadin.flow.component.InputNotifier

    addInputListener

    Methods inherited from interface com.vaadin.flow.component.KeyNotifier

    addKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
  • Constructor Details

    • LongField

      public LongField()
    • LongField

      public LongField(String label)
  • Method Details

    • setMin

      public void setMin(long min)
      Sets the minimum value for the field. Mirrors IntegerField.setMin but with a long argument. Routes to AbstractNumberField's double-typed setter — precision is exact within [-253, 253] and lossy beyond that.
    • getMin

      public long getMin()
    • setMax

      public void setMax(long max)
    • getMax

      public long getMax()
    • setStep

      public void setStep(long step)
      Sets the spinner-arrow step. Mirrors IntegerField.setStep's positive-only contract — zero / negative throws IAE, matching the web component's expectation that step is strictly positive.
    • getStep

      public long getStep()