Package org.eclipse.handly.text

# Class UiDocumentChangeRunner

java.lang.Object
org.eclipse.handly.text.UiDocumentChangeRunner

public final class UiDocumentChangeRunner extends Object
Executes a `DocumentChangeOperation` in the UI thread.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UiDocumentChangeRunner(UiSynchronizer synchronizer, DocumentChangeOperation operation)`
  Creates a new runner capable of executing the given document change operation in the UI thread.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IDocumentChange`
  `run()`
  Synchronously executes the document change operation in the UI thread.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UiDocumentChangeRunner

    public UiDocumentChangeRunner(UiSynchronizer synchronizer, DocumentChangeOperation operation)
    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 be `null`
      `operation` - a document change operation - must not be `null`

- ## Method Details

  - ### run

    public IDocumentChange run() throws org.eclipse.jface.text.BadLocationException
    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 based
      `org.eclipse.text.edits.MalformedTreeException` - if the change's edit tree is not in a valid state
      `org.eclipse.jface.text.BadLocationException` - if one of the edits in the change's edit tree could not be executed