Class DocumentUndoSupport
java.lang.Object
com.levigo.jadice.web.client.undo.DocumentUndoSupport
This collection of static methods provides access to
DefaultUndoManagers which pertain to
Documents.-
Method Summary
Modifier and TypeMethodDescriptionstatic EventListUndoTracker<Page> createTracker(Document document) Return an EventListUndoTracker tracking changes to the document's page list.static UndoManagergetUndoManager(Document document) Return the undo manager associated with the given document.static org.jadice.util.base.Factory<UndoManager, RuntimeException> Return the undo managerFactoryused to create undo managers.static voidsetUndoManager(Document document, UndoManager undoManager) Associate the given undo manager with the given document.static voidsetUndoManagerFactory(org.jadice.util.base.Factory<UndoManager, RuntimeException> undoManagerFactory) Set the undo managerFactoryused to create undo managers.
-
Method Details
-
getUndoManager
Return the undo manager associated with the given document. If no undo manager has been installed yet, a new undo manager is created using the configured undo manager factory.- Parameters:
document-- Returns:
- an UndoManager associated with the document
-
createTracker
Return an EventListUndoTracker tracking changes to the document's page list. Caveat: make sure to complete tracking at some point usingEventListUndoTracker.finish(String)orEventListUndoTracker.discard().- Parameters:
document-- Returns:
- an EventListUndoTracker tracking changes to the page list
-
setUndoManager
Associate the given undo manager with the given document. This may make sense when a single undo manager shall manage edits made on several documents. It is the responsibility of the user to manager the undo manager in a way that reasonable semantics are achieved.- Parameters:
document-undoManager-
-
getUndoManagerFactory
Return the undo managerFactoryused to create undo managers. The default factory creates undo managers usingDefaultUndoManager's default constructor.- Returns:
- the factory
-
setUndoManagerFactory
public static void setUndoManagerFactory(org.jadice.util.base.Factory<UndoManager, RuntimeException> undoManagerFactory) Set the undo managerFactoryused to create undo managers.- Parameters:
undoManagerFactory- the factory
-