T - Type of component that broadcast the event.public final class TextSelectionEvent<T extends com.vaadin.flow.component.Component & CanSelectText>
extends com.vaadin.flow.component.ComponentEvent<T>
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_SELECTION |
source| Constructor and Description |
|---|
TextSelectionEvent(T source,
boolean fromClient,
int selectionStart,
int selectionEnd,
String selectedText)
Creates a new event using the given source and indicator whether the
event originated from the client side or the server side.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getSelectedText() |
int |
getSelectionEnd() |
int |
getSelectionStart() |
boolean |
isAnythingSelected() |
getSource, isFromClient, unregisterListenertoStringpublic static final int NO_SELECTION
public TextSelectionEvent(T source, boolean fromClient, int selectionStart, int selectionEnd, String selectedText)
source - the source componentfromClient - true if the event originated from the clientselectionStart - Where selection starts in the component. Can be NO_SELECTION.selectionEnd - Where selection ends in the component. Can be NO_SELECTION.selectedText - What is the selected text. Can be empty.public int getSelectionStart()
public int getSelectionEnd()
public String getSelectedText()
public boolean isAnythingSelected()
Copyright © 2023 Miki. All rights reserved.