Class TextSelectionEvent<T extends com.vaadin.flow.component.Component & CanSelectText>

  • 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
    • 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 component
        fromClient - true if the event originated from the client
        selectionStart - 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.
    • Method Detail

      • getSelectionStart

        public int getSelectionStart()
      • getSelectionEnd

        public int getSelectionEnd()
      • getSelectedText

        public String getSelectedText()
      • isAnythingSelected

        public boolean isAnythingSelected()