|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.undo.UndoManager
edu.rice.cs.drjava.model.definitions.CompoundUndoManager
public class CompoundUndoManager
Extended UndoManager with increased functionality. Can handle aggregating multiple edits into one for the purposes of undoing and redoing. It exposes editToBeUndone and editToBeRedone (under new names); they are protected methods in UndoManager. The public methods that involve composite state are synchronized, so this manager can be accessed outside of the event thread. The internal data structures _compoundEdits and _keys are not thread safe but they only accessed only by synchronized methods. The synchronization scheme (locking on this) follows UndoManager.
Field Summary |
---|
Fields inherited from class javax.swing.undo.CompoundEdit |
---|
edits |
Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
RedoName, UndoName |
Constructor Summary | |
---|---|
CompoundUndoManager(GlobalEventNotifier notifier)
Standard constructor. |
Method Summary | |
---|---|
boolean |
_compoundEditInProgress()
Returns whether or not a compound edit is in progress. |
boolean |
addEdit(UndoableEdit e)
Adds an edit. |
boolean |
canUndo()
Returns true when a compound edit is in progress, or when there are valid stored undoable edits |
void |
documentSaved()
Informs this undo manager that the document has been saved. |
void |
endCompoundEdit(int key)
Ends a compound edit. |
void |
endLastCompoundEdit()
Ends the last compound edit that was created. |
CompoundEdit |
getLastCompoundEdit()
Gets the last Compound Edit entered into the list. |
UndoableEdit |
getNextRedo()
Gets the next redo. |
UndoableEdit |
getNextUndo()
Gets the next undo. |
String |
getUndoPresentationName()
Returns the presentation name for this undo, or delegates to super if none is available |
boolean |
isModified()
Determines if the document is in the same undo state as it was when it was last saved. |
void |
redo()
Overrides redo so that any compound edit in progress is ended before the redo is performed. |
int |
startCompoundEdit()
Starts a compound edit. |
String |
toString()
|
void |
undo()
Undoes the last undoable edit, or compound edit created by the user. |
Methods inherited from class javax.swing.undo.UndoManager |
---|
canRedo, canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, redoTo, setLimit, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo |
Methods inherited from class javax.swing.undo.CompoundEdit |
---|
die, getPresentationName, isInProgress, isSignificant, lastEdit |
Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
replaceEdit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompoundUndoManager(GlobalEventNotifier notifier)
Method Detail |
---|
public int startCompoundEdit()
public void endLastCompoundEdit()
public void endCompoundEdit(int key)
key
- the key that was returned by startCompoundEdit()public CompoundEdit getLastCompoundEdit()
public UndoableEdit getNextUndo()
public UndoableEdit getNextRedo()
public boolean addEdit(UndoableEdit e)
addEdit
in interface UndoableEdit
addEdit
in class UndoManager
e
- the edit to be added
public boolean _compoundEditInProgress()
public boolean canUndo()
canUndo
in interface UndoableEdit
canUndo
in class UndoManager
public String getUndoPresentationName()
getUndoPresentationName
in interface UndoableEdit
getUndoPresentationName
in class UndoManager
public void undo()
undo
in interface UndoableEdit
undo
in class UndoManager
public void redo()
redo
in interface UndoableEdit
redo
in class UndoManager
public void documentSaved()
public boolean isModified()
public String toString()
toString
in class UndoManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |