use of org.eclipse.text.edits.TextEditProcessor in project che by eclipse.
the class TextChange method getPreviewDocument.
//---- private helper methods --------------------------------------------------
private PreviewAndRegion getPreviewDocument(TextEditBasedChangeGroup[] changes, IProgressMonitor pm) throws CoreException {
IDocument document = new Document(getCurrentDocument(pm).get());
boolean trackChanges = getKeepPreviewEdits();
setKeepPreviewEdits(true);
TextEditProcessor processor = changes == ALL_EDITS ? createTextEditProcessor(document, TextEdit.NONE, true) : createTextEditProcessor(document, TextEdit.NONE, changes);
try {
processor.performEdits();
return new PreviewAndRegion(document, getNewRegion(changes));
} catch (BadLocationException e) {
throw Changes.asCoreException(e);
} finally {
setKeepPreviewEdits(trackChanges);
}
}
Aggregations