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
From interface java.lang.AutoCloseable

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.

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.

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.

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.

public DocSnapshot discardAllSnapshots ()

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

Returns
  • An invalid DocSnapshot.

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.

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.

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.

public ResultSnapshot takeSnapshot ()

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

Returns
  • A representation of the transition.

public ResultSnapshot undo ()

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

Returns
  • The resulting snapshot id.