TextViewerUndoManagerpublic class DefaultUndoManager extends Object implements IUndoManager, IUndoManagerExtension
IUndoManager.
It registers with the connected text viewer as text input listener and document listener and logs all changes. It also monitors mouse and keyboard activities in order to partition the stream of text changes into undo-able edit commands.
Since 3.1 this undo manager is a facade to the global operation history.
The usage of IAdaptable in the JFace
layer has been approved by Platform UI, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=87669#c9
This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
protected long |
fPreservedRedoModificationStamp
Deprecated.
The document modification stamp for redo.
|
protected long |
fPreservedUndoModificationStamp
Deprecated.
The document modification stamp for undo.
|
| Constructor and Description |
|---|
DefaultUndoManager(int undoLevel)
Deprecated.
Creates a new undo manager who remembers the specified number of edit commands.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginCompoundChange()
Deprecated.
Signals the undo manager that all subsequent changes until
endCompoundChange is called are to be undone in one piece. |
void |
connect(ITextViewer textViewer)
Deprecated.
Connects this undo manager to the given text viewer.
|
void |
disconnect()
Deprecated.
Disconnects this undo manager from its text viewer.
|
void |
endCompoundChange()
Deprecated.
Signals the undo manager that the sequence of changes which started with
beginCompoundChange has been finished. |
IUndoContext |
getUndoContext()
Deprecated.
Returns this undo manager's undo context.
|
void |
redo()
Deprecated.
Repeats the most recently rolled back text change.
|
boolean |
redoable()
Deprecated.
Returns whether at least one text change can be repeated.
|
void |
reset()
Deprecated.
Resets the history of the undo manager.
|
protected void |
selectAndReveal(int offset,
int length)
Deprecated.
Selects and reveals the specified range.
|
void |
setMaximalUndoLevel(int undoLevel)
Deprecated.
The given parameter determines the maximal length of the history
remembered by the undo manager.
|
void |
undo()
Deprecated.
Rolls back the most recently executed text change.
|
boolean |
undoable()
Deprecated.
Returns whether at least one text change can be rolled back.
|
protected long fPreservedUndoModificationStamp
protected long fPreservedRedoModificationStamp
public DefaultUndoManager(int undoLevel)
undoLevel - the length of this manager's historypublic void beginCompoundChange()
IUndoManagerendCompoundChange is called are to be undone in one piece.beginCompoundChange in interface IUndoManagerpublic void endCompoundChange()
IUndoManagerbeginCompoundChange has been finished. All subsequent changes
are considered to be individually undo-able.endCompoundChange in interface IUndoManagerpublic void setMaximalUndoLevel(int undoLevel)
IUndoManagersetMaximalUndoLevel in interface IUndoManagerundoLevel - the length of this undo manager's historypublic void connect(ITextViewer textViewer)
IUndoManagerconnect in interface IUndoManagertextViewer - the viewer the undo manager is connected topublic void disconnect()
IUndoManagerdisconnect in interface IUndoManagerpublic void reset()
IUndoManagerreset in interface IUndoManagerpublic boolean redoable()
IUndoManagerredoable in interface IUndoManagertrue if at least on text change can be repeatedpublic boolean undoable()
IUndoManagerundoable in interface IUndoManagertrue if at least one text change can be rolled backpublic void redo()
IUndoManagerredo in interface IUndoManagerpublic void undo()
IUndoManagerundo in interface IUndoManagerprotected void selectAndReveal(int offset,
int length)
offset - the offset of the rangelength - the length of the rangepublic IUndoContext getUndoContext()
IUndoManagerExtensiongetUndoContext in interface IUndoManagerExtensionnull if the undo manager is not connectedIUndoContextGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.