Package org.vaadin.miki.events.text
Class TextSelectionEvent<T extends com.vaadin.flow.component.Component & CanSelectText>
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<T>
org.vaadin.miki.events.text.TextSelectionEvent<T>
- Type Parameters:
T- Type of component that broadcast the event.
- All Implemented Interfaces:
Serializable
public final class TextSelectionEvent<T extends com.vaadin.flow.component.Component & CanSelectText>
extends com.vaadin.flow.component.ComponentEvent<T>
Component event with information about selected text.
- Since:
- 2020-05-30
- Author:
- miki
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionTextSelectionEvent(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. -
Method Summary
Modifier and TypeMethodDescriptionintintbooleanMethods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Field Details
-
NO_SELECTION
public static final int NO_SELECTION- See Also:
-
-
Constructor Details
-
TextSelectionEvent
public 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.- Parameters:
source- the source componentfromClient-trueif the event originated from the clientselectionStart- Where selection starts in the component. Can beNO_SELECTION.selectionEnd- Where selection ends in the component. Can beNO_SELECTION.selectedText- What is the selected text. Can be empty.
-
-
Method Details
-
getSelectionStart
public int getSelectionStart() -
getSelectionEnd
public int getSelectionEnd() -
getSelectedText
-
isAnythingSelected
public boolean isAnythingSelected()
-