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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intNO_SELECTION-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSelectedText()intgetSelectionEnd()intgetSelectionStart()booleanisAnythingSelected()-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Field Detail
-
NO_SELECTION
public static final int NO_SELECTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getSelectionStart
public int getSelectionStart()
-
getSelectionEnd
public int getSelectionEnd()
-
getSelectedText
public String getSelectedText()
-
isAnythingSelected
public boolean isAnythingSelected()
-
-