if (control instanceof Composite) {
parent = (Composite) control;
}
if (parent == null) {
throw new ValidationException(
"Unable to validate control because it is not a period's parent composite. This probably means the process node was incorrectly configured");
}
boolean atLeastOneSpecified = false;
for (final Control currentControl : parent.getChildren()) {
if (currentControl instanceof Spinner) {
final int elementValue = ((Spinner) currentControl).getSelection();
if (elementValue != 0) {
atLeastOneSpecified = true;
break;
}
}
}
if (!atLeastOneSpecified) {
throw new ValidationException("This field is required");
}
}