Bug 38477 add delegate methods: OK enabled even if nothing selected
20030604 the OK button is enabled even if nothing is selected in the dialog
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddDelegateMethodsAction.java
ExceptionHandler.handle(e, getShell(), DIALOG_TITLE, ActionMessages.getString("AddDelegateMethodsAction.error.actionfailed")); 
		}
	}
	private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
		if (canEnableOn(getSelectedFields(selection)))
			return true;
		if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType))
			return canEnableOn((IType) selection.getFirstElement());
		if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
			return canEnableOn(JavaElementUtil.getMainType((ICompilationUnit) selection.getFirstElement()));
		return false;
	}
	private static boolean canEnableOn(IType type) throws JavaModelException {
		if (type == null || type.getCompilationUnit() == null)
			return false;
		return canEnableOn(type.getFields());
	}
	private static boolean canEnableOn(IField[] fields) throws JavaModelException {
		if (fields == null) {
			return false;
		}
		int count = 0;
		for (int i = 0; i < fields.length; i++) {
			if (!hasPrimitiveType(fields[i]) || isArray(fields[i])) {
				count++;
			}
		}
		return (count > 0);
	}
	/*