|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a document undo manager. Tracks changes in a document and builds a history of text commands that describe the undoable changes to the document.
Clients must explicitly connect to the undo manager to express their interest in the undo history. Clients should disconnect from the undo manager when they are no longer interested in tracking the undo history. If there are no clients connected to the undo manager, it will not track the document's changes and will dispose of any history that was previously kept.
Clients may also listen to the undo manager for notifications before and after undo or redo events are performed. Clients must connect to the undo manager in addition to registering listeners.
Clients may implement this interface.
DocumentUndoManagerRegistry
,
IDocumentUndoListener
,
IDocument
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. |
Method Detail |
public void addDocumentUndoListener(IDocumentUndoListener listener)
Notifications 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.
listener
- the document undo listener to be added as a listenerpublic void removeDocumentUndoListener(IDocumentUndoListener listener)
Removing a listener which is not registered has no effect
listener
- the document undo listener to be removedpublic IUndoContext getUndoContext()
public void commit()
public void connect(Object client)
client
- the object connecting to the undo managerpublic void disconnect(Object client)
client
- the object disconnecting from the undo managerpublic void beginCompoundChange()
endCompoundChange
is called are to be undone in one piece.
public void endCompoundChange()
beginCompoundChange
has been finished. All subsequent
changes are considered to be individually undo-able.
public void setMaximalUndoLevel(int undoLimit)
undoLimit
- the length of this undo manager's historypublic void reset()
public boolean undoable()
true
if at least one text change can be rolled backpublic boolean redoable()
true
if at least on text change can be repeatedpublic void undo() throws ExecutionException
ExecutionException
- if an exception occurred during undopublic void redo() throws ExecutionException
ExecutionException
- if an exception occurred during redopublic void transferUndoHistory(IDocumentUndoManager manager)
manager
- the document undo manger whose history is to be transferred to the receiver
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.