/** * Create a highlighted range on the previewers document with the given line, column, length and * key. * * @param line the line * @param column the column * @param length the length * @param key the key * @return the highlighted range */ private HighlightedRange createHighlightedRange(int line, int column, int length, String key) { try { IDocument document = fPreviewViewer.getDocument(); int offset = document.getLineOffset(line) + column; return new HighlightedRange(offset, length, key); } catch (BadLocationException x) { CUIPlugin.log(x); } return null; }