|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.bs.mdi.UndoManager
Allows to undo or redo Actions. The UndoManager keeps track of Actions which were previously applied to the document and allows to undo or redo these Actions.
| Nested Class Summary | |
class |
UndoManager.UndoException
|
| Field Summary | |
static int |
DEFAULT_NUM_ACTIONS
|
| Constructor Summary | |
UndoManager(Document document)
Creates a new UndoManager. |
|
UndoManager(Document document,
int limit)
Creates a new UndoManager. |
|
| Method Summary | |
void |
add(Action action,
Data data)
Tells the UndoManager that an action has occurred. |
int |
countAppliedActions()
Gets the number of elements in the queue of applied actions. |
int |
countUndoneActions()
Gets the number of elements in the queue of undone actions. |
void |
flushLogs()
Flushes undo and redo logs. |
void |
flushRedoLog()
Clears the redo log. |
void |
flushUndoLog()
Clears the undo log. |
Action |
getLastAction()
Returns the last action which has been applied. |
Action |
getLastUndoneAction()
Returns the last action which has been undone. |
int |
getLimit()
Gets the current action number limit, i.e. the maximum number of action which this UndoManager will remember. |
boolean |
isRedoPossible()
Returns true if the last undone action can be redone. |
boolean |
isUndoPossible()
Returns true if the last action can be undone. |
Action |
redo()
Performs a redo operation. |
void |
removeLastAppliedAction()
Removes the last (i.e. most recent) action in the queue of applied actions. |
void |
setLimit(int limit)
Sets the current action number limit. |
Action |
undo()
Performs an undo operation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int DEFAULT_NUM_ACTIONS
| Constructor Detail |
public UndoManager(Document document)
document - the document to be associated with this UndoManager
public UndoManager(Document document,
int limit)
document - the document to be associated with this UndoManagerlimit - the maximum number of actions to remember| Method Detail |
public int getLimit()
public void setLimit(int limit)
limit - the action number limit
public void add(Action action,
Data data)
action - the action which has just occurreddata - the corresponding data objectpublic int countAppliedActions()
add(org.bs.mdi.Action, org.bs.mdi.Data) method, except
when the actions limit is exceeded.
public int countUndoneActions()
undo() method, and is
set to zero when add(org.bs.mdi.Action, org.bs.mdi.Data) is called.
public void removeLastAppliedAction()
public Action getLastAction()
public Action getLastUndoneAction()
public Action undo()
throws UndoManager.UndoException
UndoManager.UndoException
public Action redo()
throws UndoManager.UndoException
UndoManager.UndoExceptionpublic void flushUndoLog()
public void flushRedoLog()
public void flushLogs()
flushUndoLog() and flushRedoLog().
public boolean isUndoPossible()
public boolean isRedoPossible()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||