Bug 4354 Template - pressing new presents an error
- go to Preferences->Java->Templates - press the new button - you get an error saying that the template name must not be null. This is annoying since I didn't have the change to specify one.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
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++)
			templates[i].setEnabled(enable);