Summary: Ctors | Methods | Inherited Methods | [Expand All]
public class

# UndoManager

extends Object
implements AutoCloseable

java.lang.Object
↳ | com.pdftron.sdf.UndoManager

## Class Overview

The class UndoManager. Undo-redo interface; one-to-one mapped to document

## Summary

Public Constructors
| UndoManager(long impl_ptr)

Public Methods
long | __GetHandle()
boolean | canRedo() Returns a boolean indicating whether it is possible to redo from the current snapshot.
boolean | canUndo() Returns whether it is possible to undo from the current snapshot.
void | close() Frees the native memory of the object.
void | destroy() Frees the native memory of the object.
DocSnapshot | discardAllSnapshots() Forget all changes in this manager (without changing the document).
DocSnapshot | getNextRedoSnapshot() Gets the next state of the document.
DocSnapshot | getNextUndoSnapshot() Gets the previous state of the document.
ResultSnapshot | redo() Restores to the next snapshot, if there is one.
ResultSnapshot | takeSnapshot() Creates a snapshot of document state, transitions to the new snapshot.
ResultSnapshot | undo() Restores to the previous snapshot point, if there is one.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## Public Constructors

#### public UndoManager (long impl_ptr)

## Public Methods

#### public long __GetHandle ()

#### public boolean canRedo ()

Returns a boolean indicating whether it is possible to redo from the current snapshot.

##### Returns

- A boolean indicating whether it is possible to redo from the current snapshot.

##### Throws

PDFNetException |

#### public boolean canUndo ()

Returns whether it is possible to undo from the current snapshot.

##### Returns

- Whether it is possible to undo from the current snapshot.

##### Throws

PDFNetException |

#### public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public void destroy ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public DocSnapshot discardAllSnapshots ()

Forget all changes in this manager (without changing the document).

##### Returns

- An invalid DocSnapshot.

##### Throws

PDFNetException |

#### public DocSnapshot getNextRedoSnapshot ()

Gets the next state of the document. This state may be invalid if it is impossible to redo.

##### Returns

- The next state of the document. This state may be invalid if it is impossible to redo.

##### Throws

PDFNetException |

#### public DocSnapshot getNextUndoSnapshot ()

Gets the previous state of the document. This state may be invalid if it is impossible to undo.

##### Returns

- The previous state of the document. This state may be invalid if it is impossible to undo.

##### Throws

PDFNetException |

#### public ResultSnapshot redo ()

Restores to the next snapshot, if there is one.

##### Returns

- A representation of the transition to the next snapshot, if there is one.

##### Throws

PDFNetException |

#### public ResultSnapshot takeSnapshot ()

Creates a snapshot of document state, transitions to the new snapshot.

##### Returns

- A representation of the transition.

##### Throws

PDFNetException |

#### public ResultSnapshot undo ()

Restores to the previous snapshot point, if there is one.

##### Returns

- The resulting snapshot id.

##### Throws

PDFNetException |