Bug 4916 Potential IDE freeze on Template Preference Page
Comments from Adam Kiezun: SEVERE: 1. go to template pref page. 2. select the first one 3. edit the name - empty the field and then put a single space whole IDE freezes (infinite loop?)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
data.widthHint= SWTUtil.getButtonWidthHint(button);
		data.heightHint= SWTUtil.getButtonHeigthHint(button);
	
		return data;
	}
	
	private void selectionChanged1() {		
		IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
		if (selection.size() == 1) {
			Template template= (Template) selection.getFirstElement();
			enterEditor(template);		
		} else {		
			leaveEditor();
		}
		
		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)