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 (template == fCurrent) 
			return;
		
		if (fCurrent != null) 
			leaveEditor();
		
		fCurrent= template;
	
		fNameText.setText(template.getName());
		fDescriptionText.setText(template.getDescription());
		fContextCombo.select(getIndex(template.getContext()));
		fPatternEditor.getDocument().set(template.getPattern());
		if (fEditorEnabler != null) {
			fEditorEnabler.restore();
			fEditorEnabler= null;
		}
	}
	
	private void leaveEditor() {
		if (fCurrent == null)
			return;
			
					
		fCurrent.setPattern(fPatternEditor.getTextWidget().getText());
		
		fCurrent= null;
		fNameText.setText(""); 
		fDescriptionText.setText(""); 
		fContextCombo.select(getIndex("")); 
		fPatternEditor.getDocument().set("");