public class UndoRedoManager
extends java.lang.Object
UndoRedoManager
class is designed for undo and redo
operatiron on TDataBox
. Each TDataBox
instance
has a corresponding UndoRedoManager
object fetched by
TDataBox#getUndoRedoManager().
Notice that defaultly the limit value of UndoRedoManager
is
-1, so if you want to use it, you should call #setLimit(int) to set a max
value for limit the undo/redo steps.
Modifier and Type | Method and Description |
---|---|
void |
addEvent(java.lang.Object event)
Adds a new change event about corresponding box to UndoRedoManager instance.
|
void |
addUndoRedoListener(UndoRedoListener l)
Adds a new UndoRedoListener object to this UndoRedoManager object.
|
boolean |
canRedo()
Checks whether redo action can be called.
|
boolean |
canUndo()
Checks whether undo action can be called.
|
TDataBox |
getDataBox()
Gets the corresponding data box of this UndoRedoManager object.
|
java.util.LinkedList |
getEvents()
Gets a list contains all change events.
|
UndoRedoInterceptor |
getInterceptor()
Gets the UndoRedoInterceptor instance.
|
int |
getLimit()
Gets the max limit count for store undo/redo records.
|
int |
getPosition()
Gets the current position of undo/redo records.
|
java.util.List |
getUndoRedoListeners()
Gets a list contains all UndoRedoListener objects.
|
boolean |
isEnable()
Checks whether this UndoRedoManager is enabled.
|
boolean |
isIgnorePropertyChange() |
boolean |
isUndoRedoing()
checks whether is doing undo/redo action.
|
void |
redo()
Calls this to do redo action.
|
void |
removeUndoRedoListener(UndoRedoListener l)
Removes a UndoRedoListener object from this UndoRedoManager object.
|
void |
reset()
Calls this to clear all undo/redo records.
|
void |
setEnable(boolean enable)
Sets whether this UndoRedoManager is enabled.
|
void |
setIgnorePropertyChange(boolean ignorePropertyChange) |
void |
setInterceptor(UndoRedoInterceptor interceptor)
Sets the UndoRedoInterceptor instance.
|
void |
setLimit(int limit)
Sets the max limit count for store undo/redo records.
|
void |
undo()
Calls this to do undo action.
|
public boolean isIgnorePropertyChange()
public void setIgnorePropertyChange(boolean ignorePropertyChange)
public TDataBox getDataBox()
public void addUndoRedoListener(UndoRedoListener l)
l
- the UndoRedoListener object to be added.public void removeUndoRedoListener(UndoRedoListener l)
l
- the UndoRedoListener object to be removed.public java.util.List getUndoRedoListeners()
public void reset()
public boolean canUndo()
public boolean canRedo()
public void undo()
public void redo()
public void addEvent(java.lang.Object event)
event
- a new change event.public int getLimit()
public void setLimit(int limit)
limit
- the max limit count for store undo/redo records.public java.util.LinkedList getEvents()
public int getPosition()
public UndoRedoInterceptor getInterceptor()
public void setInterceptor(UndoRedoInterceptor interceptor)
interceptor
- the UndoRedoInterceptor instance.public boolean isUndoRedoing()
public boolean isEnable()
public void setEnable(boolean enable)
enable
- True is this UndoRedoManager is enabled, false otherwise.Copyright © 2002 - 2010 Serva Software. All Rights Reserved.