Class DocumentUndoSupport

java.lang.Object
com.levigo.jadice.web.client.undo.DocumentUndoSupport

public class DocumentUndoSupport extends Object
This collection of static methods provides access to DefaultUndoManagers which pertain to Documents.
  • Method Details

    • getUndoManager

      public static UndoManager getUndoManager(Document document)
      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

      public static EventListUndoTracker<Page> createTracker(Document document)
      Return an EventListUndoTracker tracking changes to the document's page list. Caveat: make sure to complete tracking at some point using EventListUndoTracker.finish(String) or EventListUndoTracker.discard().
      Parameters:
      document -
      Returns:
      an EventListUndoTracker tracking changes to the page list
    • setUndoManager

      public static void setUndoManager(Document document, UndoManager undoManager)
      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

      public static org.jadice.util.base.Factory<UndoManager,RuntimeException> getUndoManagerFactory()
      Return the undo manager Factory used to create undo managers. The default factory creates undo managers using DefaultUndoManager's default constructor.
      Returns:
      the factory
    • setUndoManagerFactory

      public static void setUndoManagerFactory(org.jadice.util.base.Factory<UndoManager,RuntimeException> undoManagerFactory)
      Set the undo manager Factory used to create undo managers.
      Parameters:
      undoManagerFactory - the factory