public final class UiBufferChangeRunner
extends java.lang.Object
BufferChangeOperation
in the UI thread.
This class is intended to be used in buffer implementations.
General clients should use IBuffer.applyChange(IBufferChange,
IProgressMonitor)
instead.Constructor and Description |
---|
UiBufferChangeRunner(UiSynchronizer synchronizer,
BufferChangeOperation operation)
Creates a new runner capable of executing the given buffer change
operation in the UI thread.
|
Modifier and Type | Method and Description |
---|---|
IBufferChange |
run(org.eclipse.core.runtime.IProgressMonitor monitor)
Synchronously executes the buffer change operation in the UI thread.
|
public UiBufferChangeRunner(UiSynchronizer synchronizer, BufferChangeOperation operation)
synchronizer
- used to execute operation in the UI thread
- must not be null
operation
- a buffer change operation
- must not be null
public IBufferChange run(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, org.eclipse.jface.text.BadLocationException
Note that an update conflict may occur if the buffer's contents have
changed since the inception of the snapshot on which the change is based.
In that case, a StaleSnapshotException
is thrown.
monitor
- a progress monitor (not null
).
The caller must not rely on IProgressMonitor.done()
having been called by the receivernull
StaleSnapshotException
- if the buffer has changed
since the inception of the snapshot on which the change is basedorg.eclipse.core.runtime.CoreException
- if save is requested by the change but the buffer
could not be savedorg.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 executedCopyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0