UndoManager

Methods
12
Fields
None

Getting one

UndoManager.new()

Methods

MethodReturnsDescription
addEdit(UndoableEdit)booleanAdds anEdit after the done edits (the undone ones are dropped, then the list is trimmed to the limit). Always true.
undoableEditHappened(UndoableEditEvent)()An UndoableEditListener that adds every edit it hears (document:addUndoableEditListener(undoManager)).
canUndo()booleanWhether there is an edit to undo.
canRedo()booleanWhether there is an edit to redo.
undo()()Undoes the last done edit: its inverse applied to the document, heard by its DocumentListeners. Nothing to undo raises `CannotUndoExcepti…
redo()()Redoes the last undone edit. Nothing to redo raises CannotRedoException.
getLimit()numberThe most edits it keeps, as last set (100 until then); below 0, any number.
setLimit(number)()Keeps at most l edits; below 0, any number.
discardAllEdits()()Forgets every edit.
getUndoPresentationName()string"Undo addition", ...; "Undo" with nothing to undo.
getRedoPresentationName()string"Redo addition", ...; "Redo" with nothing to redo.
new()UndoManagerAn empty manager.

Returned by

MethodReturnsDescription
UndoManagerClass.newUndoManagerAn empty manager.

Method details

addEdit

addEdit: (UndoManager, UndoableEdit) -> boolean

Adds anEdit after the done edits (the undone ones are dropped, then the list is trimmed to the limit). Always true.

undo

undo: (UndoManager) -> ()

Undoes the last done edit: its inverse applied to the document, heard by its DocumentListeners. Nothing to undo raises CannotUndoException.

redo

redo: (UndoManager) -> ()

Redoes the last undone edit. Nothing to redo raises CannotRedoException.

getLimit

getLimit: (UndoManager) -> number

The most edits it keeps, as last set (100 until then); below 0, any number.