StringDocument

Constructors

Link copied to clipboard
constructor(initialText: String)

Properties

Link copied to clipboard
val length: Int
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard

Returns a TextChange object, but does not apply that change. Useful for batching multiple changes together so that undo/redo treats them as a single step.

Link copied to clipboard
fun delete(from: Int, to: Int, allowMerge: Boolean = false)
Link copied to clipboard
fun deleteChange(from: Int, to: Int, allowMerge: Boolean): DeleteString?

Returns a TextChange object, but does not apply that change. Useful for batching multiple changes together so that undo/redo treats them as a single step.

Link copied to clipboard
fun insert(from: Int, toInsert: String, allowMerge: Boolean = false)
Link copied to clipboard
fun insertChange(from: Int, toInsert: String, allowMerge: Boolean): InsertString?

Returns a TextChange object, but does not apply that change. Useful for batching multiple changes together so that undo/redo treats them as a single step.

Link copied to clipboard
fun replace(from: Int, to: Int, text: String)
Link copied to clipboard
fun setText(text: String)