public class DocumentChangeOperation
extends java.lang.Object
IDocument
.Modifier and Type | Class and Description |
---|---|
protected static class |
DocumentChangeOperation.UndoChange |
Modifier and Type | Field and Description |
---|---|
protected IDocumentChange |
change |
protected org.eclipse.jface.text.IDocument |
document |
Constructor and Description |
---|
DocumentChangeOperation(org.eclipse.jface.text.IDocument document,
IDocumentChange change)
Creates a new operation that can apply the given change
to the given document.
|
Modifier and Type | Method and Description |
---|---|
protected IDocumentChange |
applyChange() |
protected org.eclipse.text.edits.UndoEdit |
applyTextEdit() |
protected void |
checkChange() |
protected org.eclipse.text.edits.TextEditProcessor |
createTextEditProcessor() |
protected IDocumentChange |
createUndoChange(org.eclipse.text.edits.UndoEdit undoEdit,
long stampToRestore) |
IDocumentChange |
execute()
Executes the document change.
|
protected ISnapshot |
getCurrentSnapshot() |
protected static long |
getModificationStampOf(org.eclipse.jface.text.IDocument document) |
protected static void |
setModificationStampOf(org.eclipse.jface.text.IDocument document,
long modificationStamp) |
protected final org.eclipse.jface.text.IDocument document
protected final IDocumentChange change
public DocumentChangeOperation(org.eclipse.jface.text.IDocument document, IDocumentChange change)
document
- must not be null
change
- must not be null
public IDocumentChange execute() throws org.eclipse.jface.text.BadLocationException
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.
null
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 executedprotected IDocumentChange applyChange() throws org.eclipse.jface.text.BadLocationException
org.eclipse.jface.text.BadLocationException
protected ISnapshot getCurrentSnapshot()
protected void checkChange()
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 IDocumentChange 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, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0