StyledTextContent.replaceTextRange

Replace the text with "newText" starting at position "start" for a length of "replaceLength". <p> Implementors have to notify the TextChangeListeners that were added using <code>addTextChangeListener</code> before and after the content is changed. A <code>TextChangingEvent</code> has to be sent to the textChanging method before the content is changed and a <code>TextChangedEvent</code> has to be sent to the textChanged method after the content has changed. The text change that occurs after the <code>TextChangingEvent</code> has been sent has to be consistent with the data provided in the <code>TextChangingEvent</code>. This data will be cached by the widget and will be used when the <code>TextChangedEvent</code> is received. <p> The <code>TextChangingEvent</code> should be set as follows: <ul> <li>event.start = start of the replaced text <li>event.newText = text that is going to be inserted or empty String if no text will be inserted <li>event.replaceCharCount = length of text that is going to be replaced <li>event.newCharCount = length of text that is going to be inserted <li>event.replaceLineCount = number of lines that are going to be replaced <li>event.newLineCount = number of new lines that are going to be inserted </ul> <b>NOTE:</b> newLineCount is the number of inserted lines and replaceLineCount is the number of deleted lines based on the change that occurs visually. For example: <ul> <li>(replaceText, newText) is> (replaceLineCount, newLineCount) <li>("", "\n") is> (0, 1) <li>("\n\n", "a") is> (2, 0) <li>("a", "\n\n") is> (0, 2) <li>("\n", "") is> (1, 0) </ul> </p>

@param start start offset of text to replace, none of the offsets include delimiters of preceding lines, offset 0 is the first character of the document @param replaceLength length of text to replace @param text text to replace @see TextChangeListener

interface StyledTextContent
void
replaceTextRange
(
int start
,,
String text
)

Meta