Class UndoRedoPool

  • All Implemented Interfaces:

    public class UndoRedoPool
    extends java.lang.Object
    Pool of Undo/Redo during a session
    See Also:
    Serialized Form
    • Constructor Detail

      • UndoRedoPool

        public UndoRedoPool​(Grant g)
        g - Grant
    • Method Detail

      • getPool

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

        public void clear()
        Clear pool
      • 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​(ObjectDB obj,
                         UndoRedo ur)
        Append a coherent undo/redo at the current undone position and discard any forward actions
        obj - Object
        ur - current UndoRedo stack
      • prepareUndoRedo

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

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

        public static void confirmUndoRedo​(ObjectDB obj)
        Confirm last collected Undo/Redo in case of success to be stored in pool
        obj - Business object
      • ignoreUndoRedo

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