|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.text.undo.DocumentUndoManager
public class DocumentUndoManager
A standard implementation of a document-based undo manager that creates an undo history based on changes to its document.
Based on the 3.1 implementation of DefaultUndoManager, it was implemented using the document-related manipulations defined in the original DefaultUndoManager, by separating the document manipulations from the viewer-specific processing.
The classes representing individual text edits (formerly text commands) were promoted from inner types to their own classes in order to support reassignment to a different undo manager.
This class is not intended to be subclassed.
IDocumentUndoManager,
DocumentUndoManagerRegistry,
IDocumentUndoListener,
IDocument| Constructor Summary | |
|---|---|
DocumentUndoManager(IDocument document)
Create a DocumentUndoManager for the given document. |
|
| Method Summary | |
|---|---|
void |
addDocumentUndoListener(IDocumentUndoListener listener)
Adds the specified listener to the list of document undo listeners that are notified before and after changes are undone or redone in the document. |
void |
beginCompoundChange()
Signals the undo manager that all subsequent changes until endCompoundChange is called are to be undone in one piece. |
void |
commit()
Closes the currently open text edit and open a new one. |
void |
connect(Object client)
Connects to the undo manager. |
void |
disconnect(Object client)
Disconnects from the undo manager. |
void |
endCompoundChange()
Signals the undo manager that the sequence of changes which started with beginCompoundChange has been finished. |
IUndoContext |
getUndoContext()
Returns the undo context registered for this document |
void |
redo()
Repeats the most recently rolled back text change. |
boolean |
redoable()
Returns whether at least one text change can be repeated. |
void |
removeDocumentUndoListener(IDocumentUndoListener listener)
Removes the specified listener from the list of document undo listeners. |
void |
reset()
Resets the history of the undo manager. |
void |
setMaximalUndoLevel(int undoLimit)
Sets the limit of the undo history to the specified value. |
void |
transferUndoHistory(IDocumentUndoManager manager)
Transfers the undo history from the specified document undo manager to this 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DocumentUndoManager(IDocument document)
document - the document whose undo history is being managed.| Method Detail |
|---|
public void addDocumentUndoListener(IDocumentUndoListener listener)
IDocumentUndoManagerNotifications will not be received if there are no clients connected to the receiver. Registering a document undo listener does not implicitly connect the listener to the receiver.
Document undo listeners must be prepared to receive notifications from a background thread. Any UI access occurring inside the implementation must be properly synchronized using the techniques specified by the client's widget library.
addDocumentUndoListener in interface IDocumentUndoManagerlistener - the document undo listener to be added as a listenerpublic void removeDocumentUndoListener(IDocumentUndoListener listener)
IDocumentUndoManagerRemoving a listener which is not registered has no effect
removeDocumentUndoListener in interface IDocumentUndoManagerlistener - the document undo listener to be removedpublic IUndoContext getUndoContext()
IDocumentUndoManager
getUndoContext in interface IDocumentUndoManagerpublic void commit()
IDocumentUndoManager
commit in interface IDocumentUndoManagerpublic void reset()
IDocumentUndoManager
reset in interface IDocumentUndoManagerpublic boolean redoable()
IDocumentUndoManager
redoable in interface IDocumentUndoManagertrue if at least on text change can be repeatedpublic boolean undoable()
IDocumentUndoManager
undoable in interface IDocumentUndoManagertrue if at least one text change can be rolled back
public void redo()
throws ExecutionException
IDocumentUndoManager
redo in interface IDocumentUndoManagerExecutionException - if an exception occurred during redo
public void undo()
throws ExecutionException
IDocumentUndoManager
undo in interface IDocumentUndoManagerExecutionException - if an exception occurred during undopublic void connect(Object client)
IDocumentUndoManager
connect in interface IDocumentUndoManagerclient - the object connecting to the undo managerpublic void disconnect(Object client)
IDocumentUndoManager
disconnect in interface IDocumentUndoManagerclient - the object disconnecting from the undo managerpublic void beginCompoundChange()
IDocumentUndoManagerendCompoundChange is called are to be undone in one piece.
beginCompoundChange in interface IDocumentUndoManagerpublic void endCompoundChange()
IDocumentUndoManagerbeginCompoundChange has been finished. All subsequent
changes are considered to be individually undo-able.
endCompoundChange in interface IDocumentUndoManagerpublic void setMaximalUndoLevel(int undoLimit)
IDocumentUndoManager
setMaximalUndoLevel in interface IDocumentUndoManagerundoLimit - the length of this undo manager's historypublic void transferUndoHistory(IDocumentUndoManager manager)
IDocumentUndoManager
transferUndoHistory in interface IDocumentUndoManagermanager - the document undo manger whose history is to be transferred to the receiver
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.