public class TextModificationDelegate<C extends com.vaadin.flow.component.Component & CanSelectText & CanReceiveSelectionEventsFromClient & CanModifyText> extends TextSelectionDelegate<C> implements CanModifyText
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.SELECTED_TEXT_ATTRIBUTE_NAME| Constructor and Description |
|---|
TextModificationDelegate(C source,
com.vaadin.flow.component.ComponentEventBus eventBus,
com.vaadin.flow.function.SerializableSupplier<String> stringValueSupplier)
Creates the delegate for a given component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
modifyText(String replacement,
int from,
int to)
Modifies the text at given coordinates.
|
addTextSelectionListener, clearSelectionOnValueChange, fireTextSelectionEvent, getSource, getSourceElement, informClientAboutSendingEvents, isReceivingSelectionEventsFromClient, onAttach, onDetach, reinitialiseListeners, select, selectAll, selectNone, setReceivingSelectionEventsFromClientclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmodifyText, modifyTextpublic TextModificationDelegate(C source, com.vaadin.flow.component.ComponentEventBus eventBus, com.vaadin.flow.function.SerializableSupplier<String> stringValueSupplier)
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.public void modifyText(String replacement, int from, int to)
CanModifyTextmodifyText in interface CanModifyTextreplacement - Text to put.from - The starting index of what to replace.to - The end index of what to replace.Copyright © 2023 Miki. All rights reserved.