try {
document.replace(start, len, replacementText);
LinkedPositionManager manager = new LinkedPositionManager(document);
LinkedPositionUI editor = new LinkedPositionUI(fViewer, manager);
editor.setFinalCaretOffset(replacementText.length() + start);
editor.enter();
} catch (BadLocationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}