public interface IUndoManager
ITextViewer
.
It monitors the text viewer and keeps a history of the changes applied to the viewer. The undo manager groups those changes into user interactions which on an undo request are rolled back in one atomic change.
In order to provide backward compatibility for clients of
IUndoManager
, extension interfaces are used as a means of
evolution. The following extension interfaces exist:
IUndoManagerExtension
since version 3.1
introducing access to the undo context.
Clients may implement this interface or use the standard implementation
TextViewerUndoManager
.
TextViewerUndoManager
,
IUndoManagerExtension
Modifier and Type | Method and Description |
---|---|
void |
beginCompoundChange()
Signals the undo manager that all subsequent changes until
endCompoundChange is called are to be undone in one piece. |
void |
connect(ITextViewer viewer)
Connects this undo manager to the given text viewer.
|
void |
disconnect()
Disconnects this undo manager from its text viewer.
|
void |
endCompoundChange()
Signals the undo manager that the sequence of changes which started with
beginCompoundChange has been finished. |
void |
redo()
Repeats the most recently rolled back text change.
|
boolean |
redoable()
Returns whether at least one text change can be repeated.
|
void |
reset()
Resets the history of the undo manager.
|
void |
setMaximalUndoLevel(int undoLevel)
The given parameter determines the maximal length of the history
remembered by the undo manager.
|
void |
undo()
Rolls back the most recently executed text change.
|
boolean |
undoable()
Returns whether at least one text change can be rolled back.
|
void connect(ITextViewer viewer)
viewer
- the viewer the undo manager is connected tovoid disconnect()
void beginCompoundChange()
endCompoundChange
is called are to be undone in one piece.void endCompoundChange()
beginCompoundChange
has been finished. All subsequent changes
are considered to be individually undo-able.void reset()
void setMaximalUndoLevel(int undoLevel)
undoLevel
- the length of this undo manager's historyboolean undoable()
true
if at least one text change can be rolled backboolean redoable()
true
if at least on text change can be repeatedvoid undo()
void redo()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.