Package com.simplicite.util
Class UndoRedoPool
- java.lang.Object
-
- com.simplicite.util.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 Summary
Constructors Constructor Description UndoRedoPool(Grant g)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRedo()
Is there something to redo ?boolean
canUndo()
Is there something to undo ?void
clear()
static void
confirmUndoRedo(ObjectDB obj)
Confirm last collected Undo/Redo in case of successUndoRedo
getBackward()
Get the backward UndoRedo if existsUndoRedo
getForward()
Get the forward UndoRedo if existsjava.util.List<UndoRedo>
getPool()
static UndoRedoPool
getPool(Grant g, boolean init)
Current user pool of undo/redojava.lang.String
getRedoLabel()
Return the label to redo if existsjava.lang.String
getRedoLabel(int index)
java.lang.String[]
getRedoLabels()
Return the labels to redo if existsjava.lang.String
getUndoLabel()
Return the label to undo if existsjava.lang.String
getUndoLabel(int index)
java.lang.String[]
getUndoLabels()
Return the labels to undo if existsstatic void
ignoreUndoRedo(ObjectDB obj)
Discard last collected Undo/Redo in case of errorstatic void
prepareUndoRedo(ObjectDB obj)
Prepare a new user Undo/Redo to collect future updatesvoid
push(ObjectDB obj, UndoRedo ur)
Append a coherent undo/redo at the current undone position and discard any forward actionsFlowXML
redo()
Redo the changes of current position (if the first object's preRedo returns true)FlowXML
undo()
Undo the changes of current position (if the first object's preUndo returns true)
-
-
-
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(ObjectDB obj, UndoRedo ur)
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 rightsinit
- 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
-
-