private PreviewAndRegion getPreviewDocument(TextEditChangeGroup[] changes) throws CoreException { IDocument document= new Document(getCurrentDocument(new NullProgressMonitor()).get()); boolean trackChanges= fTrackEdits; 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); }
public IDocument getPreviewDocument() throws CoreException { PreviewAndRegion result= getPreviewDocument(ALL_EDITS); return result.document;
	private PreviewAndRegion getPreviewDocument(TextEditChangeGroup[] changes) throws CoreException {		IDocument document= new Document(getCurrentDocument(new NullProgressMonitor()).get());		boolean trackChanges= fTrackEdits;		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);		}	}