Package org.eclipse.handly.text
Class UiDocumentChangeRunner
java.lang.Object
org.eclipse.handly.text.UiDocumentChangeRunner
Executes a
DocumentChangeOperation
in the UI thread.-
Constructor Summary
ConstructorDescriptionUiDocumentChangeRunner
(UiSynchronizer synchronizer, DocumentChangeOperation operation) Creates a new runner capable of executing the given document change operation in the UI thread. -
Method Summary
Modifier and TypeMethodDescriptionrun()
Synchronously executes the document change operation in the UI thread.
-
Constructor Details
-
UiDocumentChangeRunner
Creates a new runner capable of executing the given document change operation in the UI thread.- Parameters:
synchronizer
- used to execute operation in the UI thread - must not benull
operation
- a document change operation - must not benull
-
-
Method Details
-
run
Synchronously executes the document change operation in the UI thread.Note that an update conflict may occur if the document's contents have changed since the inception of the snapshot on which the change is based. In that case, a
StaleSnapshotException
is thrown.- Returns:
- undo change, if requested by the change. Otherwise,
null
- Throws:
StaleSnapshotException
- if the document has changed since the inception of the snapshot on which the change is basedorg.eclipse.text.edits.MalformedTreeException
- if the change's edit tree is not in a valid stateorg.eclipse.jface.text.BadLocationException
- if one of the edits in the change's edit tree could not be executed
-