ChangeImpl

interface ChangeImpl : Change

All concrete implementations of Change must also implement this. However, the public API must never expose this implementation, because undo and redo must only be called by History.

Properties

Link copied to clipboard
Link copied to clipboard
abstract val label: String

Functions

Link copied to clipboard

Adds this Change to the current Batch.

Link copied to clipboard
open fun canMergeWith(previous: Change): Boolean

When typing, lots of Change objects will be created. Undoing / redoing each character isn't what the user expects. So instead, Changes have the option to merge.

Link copied to clipboard
open fun mergeWith(previous: Change)

Mutates previous, so that it also encompasses the changes in this.

Link copied to clipboard
open fun now()

Begins a new Batch, applies this Change, and ends the Batch.

open fun now(label: String)

Begins a new Batch with the given label, applies this Change, and ends the Batch.

Link copied to clipboard
abstract fun redo()
Link copied to clipboard
abstract fun undo()