Bug 4360 Template - cursor at wrong position
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEditorPopup.java
private void updateSize() {
		if ((fShell == null) || fShell.isDisposed())
			return;
		
		StyledText text= fViewer.getTextWidget();
		Point size= text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		text.setSize(size);
		
		fComposite.setSize(size);
		fComposite.setLocation(BORDER_WIDTH, BORDER_WIDTH);
		
		size.x += BORDER_WIDTH * 2;
		size.y += BORDER_WIDTH * 2;
		fShell.setSize(size);
		text.setLocation(0, 0);
		
		for (int i= 0; i != fEditBoxes.length; i++)
			fEditBoxes[i].updatePosition(fViewer.getTextWidget());
	}		
	
	public String getText() {
		return fModel.toString();
	}
	
	public int[] getSelection() {
		return fModel.getSelection();
	}
}