java.lang.Object | |
↳ | com.pdftron.pdf.tools.UndoRedoManager |
This class is responsible for managing the undo/redo chain and importing/exporting meta-data from/to each state of the chain
isEditPageAction(Context, String)
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | UndoRedoManager.UndoRedoStateChangeListener | Listener that gets notfied when the undo/redo stack has changed |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UndoRedoManager(ToolManager toolManager)
Class constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addUndoRedoStateChangeListener(UndoRedoManager.UndoRedoStateChangeListener listener)
Ads the undo redo state change listener.
| ||||||||||
void |
annotationsCouldNotBeAdded(String errorMessage)
The overloaded implementation of
annotationsCouldNotBeAdded(String) . | ||||||||||
boolean | canRedo() | ||||||||||
boolean | canUndo() | ||||||||||
void | clearUndoRedoStateChangeListener() | ||||||||||
void |
destroy()
Cleans up resources.
| ||||||||||
JSONObject | getAnnotSnapshot(Annot annot, int page) | ||||||||||
String |
getNextRedoAction()
Returns the information attached to the next redo action
| ||||||||||
String |
getNextUndoAction()
Returns the information attached to the next undo action
| ||||||||||
static int |
getPageFrom(String info)
Returns the page number on which the page moved from.
| ||||||||||
static List<Integer> |
getPageList(String info)
Returns a list of page numbers that are involved in the given attached information.
| ||||||||||
static int |
getPageTo(String info)
Returns the page number on which the page moved to.
| ||||||||||
PDFViewCtrl | getPdfViewCtrl() | ||||||||||
static boolean |
isAddAnnotationAction(Context context, String info)
Checks if the information attached to an undo is related to adding annotations.
| ||||||||||
static boolean |
isAddPagesAction(Context context, String info)
Checks if the information attached to an undo is related to adding pages.
| ||||||||||
static boolean |
isDeletePagesAction(Context context, String info)
Checks if the information attached to an undo is related to deleting pages.
| ||||||||||
static boolean |
isEditContentAction(Context context, String info)
Checks if the information attached to an undo is related to editing pdf content.
| ||||||||||
static boolean |
isEditPageAction(Context context, String info)
Checks if the information attached to an undo is related to editing (adding, deleting, rotating, moving) pages.
| ||||||||||
static boolean |
isEditPageLabelsAction(Context context, String info)
Checks if the information attached to an undo is related to editing page labels.
| ||||||||||
static boolean |
isModifyAnnotationAction(Context context, String info)
Check if the information attached to an undo is related to modifying annotations
| ||||||||||
static boolean |
isMovePageAction(Context context, String info)
Checks if the information attached to an undo is related to moving a page.
| ||||||||||
static boolean |
isMovePagesAction(Context context, String info)
Checks if the information attached to an undo is related to moving multiple pages.
| ||||||||||
boolean |
isNextRedoEditPageAction()
Checks if the next redo action is an edit to page(s).
| ||||||||||
boolean |
isNextUndoEditPageAction()
Checks if the next undo action is an edit to page(s).
| ||||||||||
static boolean |
isRemoveAnnotationAction(Context context, String info)
Check if the information attached to an undo is related to removing annotations
| ||||||||||
static boolean |
isRotatePagesAction(Context context, String info)
Checks if the information attached to an undo is related to rotating pages.
| ||||||||||
static void |
jumpToUndoRedo(PDFViewCtrl pdfViewCtrl, String info, boolean isUndo)
Call this when
PDFViewCtrl should be updated after undo/redo and jumped to the last
modification. | ||||||||||
void | notifyUndoRedoStateChange() | ||||||||||
void |
onAllAnnotationsRemoved()
This method should be called whenever all annotations in the document are removed.
| ||||||||||
void |
onAnnotationAction()
This method should be called whenever an action applies to an annotation.
| ||||||||||
void |
onAnnotationsAdded(Map<Annot, Integer> annots)
This method should be called whenever new annotations are added to the document.
| ||||||||||
void |
onAnnotationsModified(Map<Annot, Integer> annots, Bundle extra)
This method should be called whenever annotations in the document are modified.
| ||||||||||
void |
onAnnotationsPreModify(Map<Annot, Integer> annots)
This method should be called before modifying annotations in the document.
| ||||||||||
void |
onAnnotationsPreRemove(Map<Annot, Integer> annots)
This method should be called before removing annotations.
| ||||||||||
void |
onAnnotationsRemoved(Map<Annot, Integer> annots)
This method should be called whenever annotations are removed from the document.
| ||||||||||
void |
onAnnotationsRemovedOnPage(int pageNum)
This method should be called whenever all annotations in the page are removed.
| ||||||||||
void |
onBookmarkModified(List<UserBookmarkItem> bookmarkItems)
This method should be called whenever the bookmark is modified.
| ||||||||||
void | onOutlineChanged() | ||||||||||
void |
onPageLabelsChanged()
Called when page labels have been changed
| ||||||||||
void |
onPageMoved(int from, int to)
This method should be called whenever a page is repositioned.
| ||||||||||
void |
onPagesAdded(List<Integer> pageList)
This method should be called whenever new pages are added.
| ||||||||||
void |
onPagesCropped()
This method should be called whenever the pages are cropped.
| ||||||||||
void |
onPagesDeleted(List<Integer> pageList)
This method should be called whenever pages are deleted.
| ||||||||||
void |
onPagesMoved(List<Integer> pagesMoved, int to, int currentPage)
Called when pages have been moved.
| ||||||||||
void |
onPagesRotated(List<Integer> pageList)
This method should be called whenever pages are rotated.
| ||||||||||
void | onPdfTextChanged() | ||||||||||
void | onRedaction(JSONObject jsonObj) | ||||||||||
String |
redo()
Redo the last undo.
| ||||||||||
String |
redo(int locationId, boolean sendEvent)
Redo the last undo.
| ||||||||||
void |
removeUndoRedoStateChangeListener(UndoRedoManager.UndoRedoStateChangeListener listener)
Removes the undo redo state change listener.
| ||||||||||
void | sendConsecutiveUndoRedoEvent() | ||||||||||
static void | setDebug(boolean debug) | ||||||||||
void |
setEditToolbarImpl(EditToolbarImpl editToolbarImpl)
Sets the EditToolbarImpl to use for undo/redo ink strokes
| ||||||||||
void | takeUndoSnapshotForReset() | ||||||||||
void |
takeUndoSnapshotForSafety()
This should be called before saving to remove any potential unsafe undo snapshot
| ||||||||||
String |
undo()
Undo the last modification.
| ||||||||||
String |
undo(int locationId, boolean sendEvent)
Undo the last undo.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pdftron.pdf.tools.ToolManager.AnnotationModificationListener
| |||||||||||
From interface
com.pdftron.pdf.tools.ToolManager.PdfDocModificationListener
| |||||||||||
From interface
com.pdftron.pdf.tools.ToolManager.PdfOutlineModificationListener
| |||||||||||
From interface
com.pdftron.pdf.tools.ToolManager.PdfTextModificationListener
|
Class constructor
toolManager | The ToolManager |
---|
Ads the undo redo state change listener.
listener | to add |
---|
The overloaded implementation of annotationsCouldNotBeAdded(String)
.
errorMessage | The error message |
---|
Cleans up resources.
Returns the information attached to the next redo action
Returns the information attached to the next undo action
Returns the page number on which the page moved from.
info | The information attached to an undo |
---|
Returns a list of page numbers that are involved in the given attached information.
info | The information attached to an undo |
---|
Returns the page number on which the page moved to.
info | The information attached to an undo |
---|
Checks if the information attached to an undo is related to adding annotations.
Checks if the information attached to an undo is related to adding pages.
Checks if the information attached to an undo is related to deleting pages.
Checks if the information attached to an undo is related to editing pdf content.
Checks if the information attached to an undo is related to editing (adding, deleting, rotating, moving) pages.
Checks if the information attached to an undo is related to editing page labels.
Check if the information attached to an undo is related to modifying annotations
Checks if the information attached to an undo is related to moving a page.
Checks if the information attached to an undo is related to moving multiple pages.
Checks if the next redo action is an edit to page(s).
Checks if the next undo action is an edit to page(s).
Check if the information attached to an undo is related to removing annotations
Checks if the information attached to an undo is related to rotating pages.
Call this when PDFViewCtrl
should be updated after undo/redo and jumped to the last
modification. The transition is shown using an animation.
pdfViewCtrl | The PDFViewCtrl |
---|---|
info | The attached information to undo |
isUndo | Whether the action is undo (true) or redo (false) |
This method should be called whenever all annotations in the document are removed.
Preferably call this only from raiseAllAnnotationsRemovedEvent()
This method should be called whenever an action applies to an annotation.
Preferably call this only from raiseAnnotationActionEvent()
This method should be called whenever new annotations are added to the document.
Preferably call this only from raiseAnnotationsAddedEvent(Map)
annots | The annotation that are added |
---|
This method should be called whenever annotations in the document are modified.
Preferably call this only from raiseAnnotationsModifiedEvent(Map, Bundle)
annots | The annotations that are modified |
---|
This method should be called before modifying annotations in the document.
This will let undo/redo operation know the region of annotation before and after
modification (for example, it can be used to animate between changes)
Preferably call this only from raiseAnnotationsPreModifyEvent(Map)
annots | The annotations that are going to be modified |
---|
This method should be called before removing annotations.
Preferably call this only from raiseAnnotationsPreRemoveEvent(Map)
annots | The annotations that are going to be removed |
---|
This method should be called whenever annotations are removed from the document.
Preferably call this only from raiseAnnotationsRemovedEvent(Map)
annots | The annotation that are removed |
---|
This method should be called whenever all annotations in the page are removed.
Preferably call this only from raiseAnnotationsRemovedEvent(int)
pageNum | The page number where the annotations are on |
---|
This method should be called whenever the bookmark is modified.
Preferably call this only from raiseBookmarkModified(List)
bookmarkItems | the new bookmarks after modification |
---|
Called when page labels have been changed
This method should be called whenever a page is repositioned.
from | The position on which the page moved from |
---|---|
to | The position on which the page moved to |
This method should be called whenever new pages are added.
Preferably call this only from raisePagesAdded(List)
pageList | The list of added pages |
---|
This method should be called whenever the pages are cropped.
Preferably call this only from raisePagesCropped()
This method should be called whenever pages are deleted.
Preferably call this only from raisePagesDeleted(List)
pageList | The list of deleted pages |
---|
Called when pages have been moved.
pagesMoved | The page numbers which the pages moved from |
---|---|
to | The page number on which the page moved to |
currentPage | The current page the viewer is on |
This method should be called whenever pages are rotated.
Preferably call this only from raisePagesRotated(List)
pageList | The list of rotated pages |
---|
Redo the last undo.
Redo the last undo.
locationId | The location ID of where this is called from. It will be used in Analytics Handler. |
---|---|
sendEvent | Whether it sends analytics event |
Removes the undo redo state change listener.
listener | to remove |
---|
Sets the EditToolbarImpl to use for undo/redo ink strokes
This should be called before saving to remove any potential unsafe undo snapshot
Undo the last modification.
Undo the last undo.
locationId | The location ID of where this is called from. It will be used in Analytics Handler. |
---|---|
sendEvent | Whether it sends analytics event |