Struct undo::UndoGroup [] [src]

pub struct UndoGroup<'a> { /* fields omitted */ }

A collection of UndoStacks.

An UndoGroup is useful when working with multiple UndoStacks and only one of them should be active at a given time, eg. a text editor with multiple documents opened. However, if only a single stack is needed, it is easier to just use the UndoStack directly.

Methods

impl<'a> UndoGroup<'a>
[src]

Creates a new UndoGroup.

Creates a new UndoGroup with the specified capacity.

Returns the capacity of the UndoGroup.

Shrinks the capacity of the UndoGroup as much as possible.

Adds an UndoStack to the group and returns an unique id for this stack.

Removes the UndoStack with the specified id and returns the stack. Returns None if the stack was not found.

Sets the UndoStack with the specified id as the current active one.

Clears the current active UndoStack.

Calls is_clean on the active UndoStack, if there is one. Returns None if there is no active stack.

Calls is_dirty on the active UndoStack, if there is one. Returns None if there is no active stack.

Calls push on the active UndoStack, if there is one. Does nothing if there is no active stack.

Calls redo on the active UndoStack, if there is one. Does nothing if there is no active stack.

Calls undo on the active UndoStack, if there is one. Does nothing if there is no active stack.