boolean valid= fNameText == null || fNameText.getText().trim().length() != 0; if (!valid) { StatusInfo status = new StatusInfo(); status.setError(PreferencesMessages.EditTemplateDialog_error_noname); updateButtonsEnableState(status); }
updateStatusAndButtons(); boolean isEmpty= fNameText != null && fNameText.getText().length() == 0; getButton(IDialogConstants.OK_ID).setEnabled(!isEmpty);
	public void create() {		super.create();		// update initial OK button to be disabled for new templates 		boolean valid= fNameText == null || fNameText.getText().trim().length() != 0;		if (!valid) {			StatusInfo status = new StatusInfo();			status.setError(PreferencesMessages.EditTemplateDialog_error_noname); 			updateButtonsEnableState(status); 		}	}