public class UndoRedo
extends java.lang.Object
implements java.io.Serializable
Undo/Redo management
Constructor and Description |
---|
UndoRedo(boolean serialize,
int maxSize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
append(Grant g,
UndoRedo ur)
Append Undo/Redo
|
boolean |
canRedo()
Is there something to redo ?
|
boolean |
canUndo()
Is there something to undo ?
|
void |
clear(Grant g)
Clear all undo/redo
|
ObjectXML |
getCurrentRedo()
Return the current redo if exists
|
ObjectXML |
getCurrentUndo()
Return the current undo if exists
|
FlowXML |
getRedo()
Redo flow
|
java.io.File |
getRedoFile(Grant g) |
FlowXML |
getUndo()
Undo flow
|
java.io.File |
getUndoFile(Grant g) |
boolean |
isRedoEnabled(int index)
Is redo enabled at index ?
|
boolean |
isUndoEnabled(int index)
Is undo enabled at index ?
|
void |
push(Grant g,
ObjectXML redo,
ObjectXML undo) |
void |
push(ObjectDB obj,
java.lang.String action,
boolean timestamp,
boolean patchMode)
Insert the object patch at current position and discard forward redo (if isUndoable of object returns true)
|
ObjectXML |
redo(Grant g)
Redo the changes of current position (if preRedo of object returns true)
|
void |
redoAll(Grant g)
Redo all changes (if preRedo of object returns true)
|
void |
setEnabled(boolean enabled)
Push enabling
|
java.lang.String |
toString() |
ObjectXML |
undo(Grant g)
Undo the changes of current position (if preUndo of object returns true)
|
void |
undoAll(Grant g)
Undo all changes (if preUndo of object returns true)
|
void |
writeFiles(Grant g) |
public UndoRedo(boolean serialize, int maxSize)
serialize
- True to save Undo/Redo into filesmaxSize
- Redo max size (0=not limited)public FlowXML getRedo()
public FlowXML getUndo()
public void setEnabled(boolean enabled)
public void clear(Grant g)
public boolean canUndo()
public boolean isUndoEnabled(int index)
public boolean canRedo()
public boolean isRedoEnabled(int index)
public ObjectXML getCurrentRedo()
public ObjectXML redo(Grant g)
public void redoAll(Grant g)
public ObjectXML getCurrentUndo()
public ObjectXML undo(Grant g)
public void undoAll(Grant g)
public void push(ObjectDB obj, java.lang.String action, boolean timestamp, boolean patchMode)
obj
- Object with current fieldsaction
- Action ObjectXML.ACTION_*timestamp
- Push the timestamppatchMode
- Push changed field onlypublic void writeFiles(Grant g)
public java.io.File getRedoFile(Grant g)
public java.io.File getUndoFile(Grant g)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.