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
public boolean performOk() {
		IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
		prefs.setValue(PREF_FORMAT_TEMPLATES, fFormatButton.getSelection());
		TemplateSet.getInstance().save();
		
		return super.performOk();
	}	
	
	/*
	 * @see PreferencePage#performCancel()
	 */
	public boolean performCancel() {
		TemplateSet.getInstance().reset();
		return super.performCancel();
	}
	
	/**
	 * Initializes the default values of this page in the preference bundle.
	 * Will be called on startup of the JavaPlugin
	 */
	public static void initDefaults(IPreferenceStore prefs) {
		prefs.setDefault(PREF_FORMAT_TEMPLATES, true);
	}
	public static boolean useCodeFormatter() {
		IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
		return prefs.getBoolean(PREF_FORMAT_TEMPLATES);
	}
	
}