public class BufferChangeOperation
extends java.lang.Object
IBuffer
.
This class is intended to be used in implementations of IBuffer
.
General clients should use IBuffer.applyChange(IBufferChange,
IProgressMonitor)
instead.Modifier and Type | Class and Description |
---|---|
protected class |
BufferChangeOperation.ChangeEditProcessor |
protected static class |
BufferChangeOperation.UndoChange |
Modifier and Type | Field and Description |
---|---|
protected IBuffer |
buffer |
protected IBufferChange |
change |
Constructor and Description |
---|
BufferChangeOperation(IBuffer buffer,
IBufferChange change)
Creates a new operation that can apply the given change
to the given buffer.
|
Modifier and Type | Method and Description |
---|---|
protected IBufferChange |
applyChange(org.eclipse.core.runtime.IProgressMonitor monitor) |
protected org.eclipse.text.edits.UndoEdit |
applyTextEdit() |
protected void |
checkChange() |
protected org.eclipse.text.edits.TextEditProcessor |
createTextEditProcessor() |
protected IBufferChange |
createUndoChange(org.eclipse.text.edits.UndoEdit undoEdit,
long stampToRestore) |
IBufferChange |
execute(org.eclipse.core.runtime.IProgressMonitor monitor)
Executes the buffer change.
|
protected static long |
getModificationStampOf(org.eclipse.jface.text.IDocument document) |
protected static void |
setModificationStampOf(org.eclipse.jface.text.IDocument document,
long modificationStamp) |
protected final IBuffer buffer
protected final IBufferChange change
public BufferChangeOperation(IBuffer buffer, IBufferChange change)
buffer
- must not be null
change
- must not be null
public IBufferChange execute(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 executedprotected IBufferChange applyChange(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, org.eclipse.jface.text.BadLocationException
org.eclipse.core.runtime.CoreException
org.eclipse.jface.text.BadLocationException
protected void checkChange() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected org.eclipse.text.edits.UndoEdit applyTextEdit() throws org.eclipse.jface.text.BadLocationException
org.eclipse.jface.text.BadLocationException
protected org.eclipse.text.edits.TextEditProcessor createTextEditProcessor()
protected IBufferChange createUndoChange(org.eclipse.text.edits.UndoEdit undoEdit, long stampToRestore)
protected static long getModificationStampOf(org.eclipse.jface.text.IDocument document)
protected static void setModificationStampOf(org.eclipse.jface.text.IDocument document, long modificationStamp)
Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0