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

    • Constructor Detail

      • 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 Detail

      • 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.