Class UndoRedoPool

  • All Implemented Interfaces:
    java.io.Serializable

    public class UndoRedoPool
    extends java.lang.Object
    implements java.io.Serializable
    Pool of Undo/Redo
    See Also:
    Serialized Form
    • Constructor Detail

      • UndoRedoPool

        public UndoRedoPool​(Grant g)
        Constructor
        Parameters:
        g - Grant
    • Method Detail

      • getPool

        public java.util.List<UndoRedo> getPool()
      • clear

        public void clear()
      • canUndo

        public boolean canUndo()
        Is there something to undo ?
      • getUndoLabel

        public java.lang.String getUndoLabel()
        Return the label to undo if exists
      • getUndoLabel

        public java.lang.String getUndoLabel​(int index)
      • getUndoLabels

        public java.lang.String[] getUndoLabels()
        Return the labels to undo if exists
      • canRedo

        public boolean canRedo()
        Is there something to redo ?
      • getRedoLabel

        public java.lang.String getRedoLabel()
        Return the label to redo if exists
      • getRedoLabel

        public java.lang.String getRedoLabel​(int index)
      • getRedoLabels

        public java.lang.String[] getRedoLabels()
        Return the labels to redo if exists
      • getBackward

        public UndoRedo getBackward()
        Get the backward UndoRedo if exists
      • getForward

        public UndoRedo getForward()
        Get the forward UndoRedo if exists
      • undo

        public FlowXML undo()
        Undo the changes of current position (if the first object's preUndo returns true)
      • redo

        public FlowXML redo()
        Redo the changes of current position (if the first object's preRedo returns true)
      • push

        public void push​(UndoRedo ur,
                         boolean redolog)
        Append a coherent undo/redo at the current undone position and discard any forward actions
      • prepareUndoRedo

        public static void prepareUndoRedo​(ObjectDB obj)
        Prepare a new user Undo/Redo to collect future updates
      • getPool

        public static UndoRedoPool getPool​(Grant g,
                                           boolean init)
        Current user pool of undo/redo
        Parameters:
        g - User rights
        init - Build a new one if unset (size based on max rows)
        Returns:
        The unod/redo pool if exists
      • confirmUndoRedo

        public static void confirmUndoRedo​(ObjectDB obj)
        Confirm last collected Undo/Redo in case of success
      • ignoreUndoRedo

        public static void ignoreUndoRedo​(ObjectDB obj)
        Discard last collected Undo/Redo in case of error