Bug 4360 Template - cursor at wrong position
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEditorPopup.java
}
		fShell= null;
	}
	
	public boolean open() {	
		create();
		show();
		
		Display display= fShell.getDisplay();
		
		
		while (display.readAndDispatch());
		fEditBoxes[0].selectAll();				
		
		while ((fShell != null) && !fShell.isDisposed())
			if (!display.readAndDispatch())
				display.sleep();
				
		return fResult;	
	}
	
	private int findEditBoxIndex(TypedEvent e) {
		StyledText text= (StyledText) e.widget;
		for (int i= 0; i != fEditBoxes.length; i++) 
			if (fEditBoxes[i].getText().equals(text))
				return i;
				
		return -1;
	}