Package org.vaadin.miki.shared.text
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:
-
Field Summary
Fields inherited from class org.vaadin.miki.shared.text.TextSelectionDelegate
SELECTED_TEXT_ATTRIBUTE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionTextModificationDelegate(C source, com.vaadin.flow.component.ComponentEventBus eventBus, com.vaadin.flow.function.SerializableSupplier<String> stringValueSupplier) Creates the delegate for a given component. -
Method Summary
Modifier and TypeMethodDescriptionvoidmodifyText(String replacement, int from, int to) Modifies the text at given coordinates.Methods inherited from class org.vaadin.miki.shared.text.TextSelectionDelegate
addTextSelectionListener, clearSelectionOnValueChange, fireTextSelectionEvent, getSource, getSourceElement, informClientAboutSendingEvents, isReceivingSelectionEventsFromClient, onAttach, onDetach, reinitialiseListeners, select, selectAll, selectNone, setReceivingSelectionEventsFromClientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vaadin.miki.markers.CanModifyText
modifyText, modifyText
-
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 aString.
-
-
Method Details
-
modifyText
Description copied from interface:CanModifyTextModifies the text at given coordinates.- Specified by:
modifyTextin interfaceCanModifyText- Parameters:
replacement- Text to put.from- The starting index of what to replace.to- The end index of what to replace.
-