final DefaultMutableTreeNode thisNode = getNode();
final List<String> changed = new ArrayList<String>();
final List<String> incorrect = new ArrayList<String>();
if (thisNode == null) {
incorrect.add("missing node");
return new Check(incorrect, changed);
}
boolean cor = false;
for (final Host host : getBrowser().getClusterHosts()) {
if (!definedOnHostComboBoxHash.containsKey(host.getName())) {
continue;
}
final Widget hostWi = definedOnHostComboBoxHash.get(host.getName());
final Widget wizardHostWi = definedOnHostComboBoxHash.get(WIZARD_HOST_PREFIX + host.getName());
final Value value = hostWi.getValue();
final VmsXml vmsXml = getBrowser().getVmsXml(host);
final Value savedValue;
if (vmsXml != null && vmsXml.getDomainNames().contains(getDomainName())) {
savedValue = DEFINED_ON_HOST_TRUE;
} else {
savedValue = DEFINED_ON_HOST_FALSE;
}
hostWi.setBackground(value, savedValue, false);
if (wizardHostWi != null) {
wizardHostWi.setBackground(value, savedValue, false);
}
if (DEFINED_ON_HOST_TRUE.equals(value)) {
cor = true; /* at least one */
}
if ((vmsXml == null
|| (!getResource().isNew() && !vmsXml.getDomainNames().contains(getDomainName())))
&& DEFINED_ON_HOST_TRUE.equals(value)) {
changed.add("host");
} else if (vmsXml != null
&& vmsXml.getDomainNames().contains(getDomainName())
&& DEFINED_ON_HOST_FALSE.equals(value)) {
changed.add("host");
}
}
if (!cor) {
for (final String key : definedOnHostComboBoxHash.keySet()) {
definedOnHostComboBoxHash.get(key).wrongValue();
}
incorrect.add("no host");
}
@SuppressWarnings("unchecked")
final Check check = new Check(incorrect, changed);
check.addCheck(super.checkResourceFields(param, params));
for (final Info info : treeMenuController.nodesToInfos(thisNode.children())) {
final HardwareInfo hardwareInfo = (HardwareInfo) info;
check.addCheck(hardwareInfo.checkResourceFields(null, hardwareInfo.getRealParametersFromXML(), true));
}
return check;
}