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
updateButtons();
	}
	
	private void updateButtons() {
		int selectionCount= ((IStructuredSelection) fTableViewer.getSelection()).size();
		int itemCount= fTableViewer.getTable().getItemCount();
		
		boolean error= (fCurrent != null) && (fCurrent.getName().length() == 0);
		
		fAddButton.setEnabled(!error);
		fRemoveButton.setEnabled(selectionCount > 0 && selectionCount <= itemCount);
		fEnableAllButton.setEnabled(itemCount > 0);
		fDisableAllButton.setEnabled(itemCount > 0);
		StatusInfo status= new StatusInfo();
		if (error)
			status.setError(TemplateMessages.getString("TemplatePreferencePage.error.noname")); 
		setValid(!status.matches(IStatus.ERROR));
		StatusUtil.applyToStatusLine(this, status);			
	}
	
	private static int getIndex(String context) {
		if (context.equals("java")) 
			return 0;
		else if (context.equals("javadoc")) 
			return 1;
		else
			return -1;
	}
	private void enterEditor(Template template) {