UndoableOperation

data class UndoableOperation(val description: String, val undo: () -> Unit, val redo: () -> Unit)(source)

A single reversible change pushed onto an UndoStack. The caller is expected to perform the change before pushing the operation; undo reverts that change, redo re-applies it.

Constructors

Link copied to clipboard
constructor(description: String, undo: () -> Unit, redo: () -> Unit)

Properties

Link copied to clipboard

human-readable label for menu items like "Undo Add Scenario". Free-form; the editor decides whether to prefix "Undo " / "Redo " in its menu rendering.

Link copied to clipboard
val redo: () -> Unit

invoked when the user asks to redo it after a prior undo.

Link copied to clipboard
val undo: () -> Unit

invoked when the user asks to undo this operation.