Package org.eclipse.jface.text
Class DefaultUndoManager
- java.lang.Object
-
- org.eclipse.jface.text.DefaultUndoManager
-
- All Implemented Interfaces:
IUndoManager,IUndoManagerExtension
@Deprecated public class DefaultUndoManager extends Object implements IUndoManager, IUndoManagerExtension
Deprecated.As of 3.2, replaced byTextViewerUndoManagerStandard implementation ofIUndoManager.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
IAdaptablein the JFace layer has been approved by Platform UI, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=87669#c9This class is not intended to be subclassed.
- See Also:
ITextViewer,ITextInputListener,IDocumentListener,IUndoableOperation,IOperationHistory,MouseListener,KeyListener- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description protected longfPreservedRedoModificationStampDeprecated.The document modification stamp for redo.protected longfPreservedUndoModificationStampDeprecated.The document modification stamp for undo.
-
Constructor Summary
Constructors Constructor Description DefaultUndoManager(int undoLevel)Deprecated.Creates a new undo manager who remembers the specified number of edit commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbeginCompoundChange()Deprecated.Signals the undo manager that all subsequent changes untilendCompoundChangeis called are to be undone in one piece.voidconnect(ITextViewer textViewer)Deprecated.Connects this undo manager to the given text viewer.voiddisconnect()Deprecated.Disconnects this undo manager from its text viewer.voidendCompoundChange()Deprecated.Signals the undo manager that the sequence of changes which started withbeginCompoundChangehas been finished.IUndoContextgetUndoContext()Deprecated.Returns this undo manager's undo context.voidredo()Deprecated.Repeats the most recently rolled back text change.booleanredoable()Deprecated.Returns whether at least one text change can be repeated.voidreset()Deprecated.Resets the history of the undo manager.protected voidselectAndReveal(int offset, int length)Deprecated.Selects and reveals the specified range.voidsetMaximalUndoLevel(int undoLevel)Deprecated.The given parameter determines the maximal length of the history remembered by the undo manager.voidundo()Deprecated.Rolls back the most recently executed text change.booleanundoable()Deprecated.Returns whether at least one text change can be rolled back.
-
-
-
Method Detail
-
beginCompoundChange
public void beginCompoundChange()
Deprecated.Description copied from interface:IUndoManagerSignals the undo manager that all subsequent changes untilendCompoundChangeis called are to be undone in one piece.- Specified by:
beginCompoundChangein interfaceIUndoManager
-
endCompoundChange
public void endCompoundChange()
Deprecated.Description copied from interface:IUndoManagerSignals the undo manager that the sequence of changes which started withbeginCompoundChangehas been finished. All subsequent changes are considered to be individually undo-able.- Specified by:
endCompoundChangein interfaceIUndoManager
-
setMaximalUndoLevel
public void setMaximalUndoLevel(int undoLevel)
Deprecated.Description copied from interface:IUndoManagerThe given parameter determines the maximal length of the history remembered by the undo manager.- Specified by:
setMaximalUndoLevelin interfaceIUndoManager- Parameters:
undoLevel- the length of this undo manager's history
-
connect
public void connect(ITextViewer textViewer)
Deprecated.Description copied from interface:IUndoManagerConnects this undo manager to the given text viewer.- Specified by:
connectin interfaceIUndoManager- Parameters:
textViewer- the viewer the undo manager is connected to
-
disconnect
public void disconnect()
Deprecated.Description copied from interface:IUndoManagerDisconnects this undo manager from its text viewer. If this undo manager hasn't been connected before this operation has no effect.- Specified by:
disconnectin interfaceIUndoManager
-
reset
public void reset()
Deprecated.Description copied from interface:IUndoManagerResets the history of the undo manager. After that call, there aren't any undo-able or redo-able text changes.- Specified by:
resetin interfaceIUndoManager
-
redoable
public boolean redoable()
Deprecated.Description copied from interface:IUndoManagerReturns whether at least one text change can be repeated. A text change can be repeated only if it was executed and rolled back.- Specified by:
redoablein interfaceIUndoManager- Returns:
trueif at least on text change can be repeated
-
undoable
public boolean undoable()
Deprecated.Description copied from interface:IUndoManagerReturns whether at least one text change can be rolled back.- Specified by:
undoablein interfaceIUndoManager- Returns:
trueif at least one text change can be rolled back
-
redo
public void redo()
Deprecated.Description copied from interface:IUndoManagerRepeats the most recently rolled back text change.- Specified by:
redoin interfaceIUndoManager
-
undo
public void undo()
Deprecated.Description copied from interface:IUndoManagerRolls back the most recently executed text change.- Specified by:
undoin interfaceIUndoManager
-
selectAndReveal
protected void selectAndReveal(int offset, int length)Deprecated.Selects and reveals the specified range.- Parameters:
offset- the offset of the rangelength- the length of the range- Since:
- 3.0
-
getUndoContext
public IUndoContext getUndoContext()
Deprecated.Description copied from interface:IUndoManagerExtensionReturns this undo manager's undo context.- Specified by:
getUndoContextin interfaceIUndoManagerExtension- Returns:
- the undo context or
nullif the undo manager is not connected - See Also:
IUndoContext
-
-