Bug 4358 Template - steals closing bracket
Steps to reproduce - press new - enter name for - enter description for(collection, type, var) - iterate over collection - enter pattern for (Iterator iter= ${0}.iterator; iter.hasNext(); ) { ${1} ${2}= (${1})iter.next(); ${cursor} - press return several times - position cursor after ${cursor} - press enter - press } - press OK - reopen dialog ==> observe: closing bracket } is missing.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fContextCombo.select(getIndex("")); 
		fPatternEditor.getDocument().set(""); 
		if (fEditorEnabler == null)
			fEditorEnabler= ControlEnableState.disable(fEditor);		
	}
	
	private void add() {
		Template template= new Template();
		template.setContext("java"); 
		TemplateSet.getInstance().add(template);
		fTableViewer.refresh();
		fTableViewer.setChecked(template, template.isEnabled());
		enterEditor(template);
		fNameText.setFocus();
	}
	
	private void remove() {
		IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
		Iterator elements= selection.iterator();
		while (elements.hasNext()) {
			Template template= (Template) elements.next();
			TemplateSet.getInstance().remove(template);
		}
		leaveEditor();		
		fTableViewer.refresh();
	}
	
	private void enableAll(boolean enable) {
		Template[] templates= TemplateSet.getInstance().getTemplates();
		for (int i= 0; i != templates.length; i++)