Bug 4360 Template - cursor at wrong position
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEditorPopup.java
for (int i= 0; i != count; i++) {
			fEditBoxes[i]= new EditBox(fComposite, fContext, fModel, indices[i]);
			fEditBoxes[i].getText().addFocusListener(this);
		}
		fViewer= createViewer(fComposite);
		fViewer.getTextWidget().setText(fModel.toString());
	}
	private static SourceViewer createViewer(Composite parent) {
		SourceViewer viewer= new SourceViewer(parent, null, SWT.NONE);
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		viewer.configure(new JavaSourceViewerConfiguration(tools, null));
		viewer.setEditable(false);
		viewer.setDocument(new Document());
		Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
		viewer.getTextWidget().setFont(font);		
		return viewer;
	}	
	
	private void show() {
		updateSize();
		updatePosition();		
		fShell.open();
	}
	
	public void dispose() {
		if ((fShell != null) && !fShell.isDisposed()) {
			fShell.dispose();
			Control control= fContext.getViewer().getTextWidget();
			control.getShell().removeControlListener(this);