Class UndoManagerImpl<T extends AbstractUndoableEdit>

  • Type Parameters:
    T - undoable edit type
    All Implemented Interfaces:
    com.im.df.api.support.DFUndoManager<T>

    public class UndoManagerImpl<T extends AbstractUndoableEdit>
    extends Object
    implements com.im.df.api.support.DFUndoManager<T>
    TODO P2 - make this class synchronized!!!
    Author:
    Petr Hamernik
    • Constructor Detail

      • UndoManagerImpl

        public UndoManagerImpl()
    • Method Detail

      • addUndoableEdit

        public void addUndoableEdit​(T edit)
        Specified by:
        addUndoableEdit in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • startComplexUndo

        public void startComplexUndo​(String presentationName,
                                     com.im.commons.progress.DFLockable lockable,
                                     com.im.commons.progress.DFLock lock)
        Specified by:
        startComplexUndo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • stopComplexUndo

        public void stopComplexUndo​(com.im.commons.progress.DFLockable lockable)
        Specified by:
        stopComplexUndo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • canUndo

        public boolean canUndo()
        Specified by:
        canUndo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • canRedo

        public boolean canRedo()
        Specified by:
        canRedo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • undo

        public void undo​(com.im.commons.progress.DFEnvironmentRO env)
                  throws com.im.df.api.support.DFUndoRedoException
        Specified by:
        undo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
        Throws:
        com.im.df.api.support.DFUndoRedoException
      • redo

        public void redo​(com.im.commons.progress.DFEnvironmentRO env)
                  throws com.im.df.api.support.DFUndoRedoException
        Specified by:
        redo in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
        Throws:
        com.im.df.api.support.DFUndoRedoException
      • discardAllEdits

        public void discardAllEdits()
        Specified by:
        discardAllEdits in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • getRedoPresentationName

        public String getRedoPresentationName()
        Specified by:
        getRedoPresentationName in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • getUndoPresentationName

        public String getUndoPresentationName()
        Specified by:
        getUndoPresentationName in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • addChangeListener

        public void addChangeListener​(ChangeListener listener)
        Specified by:
        addChangeListener in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • removeChangeListener

        public void removeChangeListener​(ChangeListener listener)
        Specified by:
        removeChangeListener in interface com.im.df.api.support.DFUndoManager<T extends AbstractUndoableEdit>
      • getUndoStack

        protected Stack<T> getUndoStack()
      • getRedoStack

        protected Stack<T> getRedoStack()