Class TextModificationDelegate<C extends com.vaadin.flow.component.Component & CanSelectText & CanReceiveSelectionEventsFromClient & CanModifyText>

java.lang.Object
org.vaadin.miki.shared.text.TextSelectionDelegate<C>
org.vaadin.miki.shared.text.TextModificationDelegate<C>
All Implemented Interfaces:
Serializable, TextSelectionNotifier<C>, CanModifyText, CanReceiveSelectionEventsFromClient, CanSelectText

public class TextModificationDelegate<C extends com.vaadin.flow.component.Component & CanSelectText & CanReceiveSelectionEventsFromClient & CanModifyText> extends TextSelectionDelegate<C> implements CanModifyText
A delegate to handle CanModifyText in various components. Extension of the TextSelectionDelegate, as the js function is in the same module, but should not be exposed to all components.
Since:
2021-03-26
Author:
miki
See Also:
  • Constructor Details

    • TextModificationDelegate

      public TextModificationDelegate(C source, com.vaadin.flow.component.ComponentEventBus eventBus, com.vaadin.flow.function.SerializableSupplier<String> stringValueSupplier)
      Creates the delegate for a given component.
      Parameters:
      source - Source of all events, data, etc.
      eventBus - Event bus to use for firing events. Typically, source.getEventBus().
      stringValueSupplier - Method to obtain current value of the component as a String.
  • Method Details

    • modifyText

      public void modifyText(String replacement, int from, int to)
      Description copied from interface: CanModifyText
      Modifies the text at given coordinates.
      Specified by:
      modifyText in interface CanModifyText
      Parameters:
      replacement - Text to put.
      from - The starting index of what to replace.
      to - The end index of what to replace.