Bug 6147 Templates don't work in "Show source of selected element only" mode
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
int offset= fFramePosition.getOffset() + fCaretOffset - region.getOffset();
		
		if ((offset >= 0) && (offset <= region.getLength()))	
			fViewer.getTextWidget().setCaretOffset(offset);
	}
	/*
	 * @see ModifyListener#modifyText(ModifyEvent)
	 */	 
	public void modifyText(ModifyEvent e) {
		
		redrawRegion();
		updateCaret();
	}
	private static void openErrorDialog(Shell shell, Exception e) {
		MessageDialog.openError(shell, LinkedPositionMessages.getString("LinkedPositionUI.error.title"), e.getMessage()); 
	}
	/*
	 * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument)
	 */
	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
		
		int flags= UNINSTALL | COMMIT | (oldInput.equals(newInput) ? 0 : DOCUMENT_CHANGED);
		leave(flags);
	}
	/*
	 * @see ITextInputListener#inputDocumentChanged(IDocument, IDocument)
	 */
	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
	}
}