Interface SelectionApi
- All Superinterfaces:
com.vaadin.flow.component.HasElement,com.vaadin.flow.component.shared.HasTextSelection,Serializable
- All Known Subinterfaces:
FluentVaadinTextField<S,F, T>
- All Known Implementing Classes:
VBigDecimalField,VDatePicker,VEmailField,VIntegerField,VNumberField,VPasswordField,VTextArea,VTextField
public interface SelectionApi
extends com.vaadin.flow.component.shared.HasTextSelection
Text selection helpers for field components wrapping a native input.
Since Vaadin 25.4 the setters (HasTextSelection.setSelectionRange(int, int),
HasTextSelection.selectAll() and HasTextSelection.setCursorPosition(int)) come from the core
HasTextSelection interface. This interface adds asynchronous getters
for the current selection and cursor position, and makes the selection
setters available also for fields that don't support them in core (like
EmailField, NumberField, IntegerField and DatePicker).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.vaadin.flow.component.shared.HasTextSelection
com.vaadin.flow.component.shared.HasTextSelection.TextSelectionJs -
Method Summary
Modifier and TypeMethodDescriptiondefault voidgetCursorPosition(com.vaadin.flow.function.SerializableConsumer<Integer> callback) Asynchronously gets the current cursor position for this field.default voidAsynchronously gets the current selection for this field.Methods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.shared.HasTextSelection
selectAll, setCursorPosition, setSelectionRange
-
Method Details
-
getSelectionRange
Asynchronously gets the current selection for this field.- Parameters:
callback- the callback to notify the selection
-
getCursorPosition
Asynchronously gets the current cursor position for this field.- Parameters:
callback- the callback to notify the position
-