//Validate targets before starting design
log.printSectionHeader("Validating targets"); //$NON-NLS-1$
setStatus(CoreMessages.getString("ProbeDesignTask.MESSAGE_VALIDATING")); //$NON-NLS-1$
//Check the validity of validatable targets
for (Iterator<ProbeMakerTarget> ti = targets.iterator(); ti.hasNext(); ) {
Target target = ti.next();
if (target instanceof ValidatingTarget) {
ValidatingTarget vt = (ValidatingTarget) target;
switch (vt.isValidTarget()) {
case ValidatingTarget.OK:
break;
case ValidatingTarget.INVALID:
throw new UnsupportedOperationException(target.getID() +
CoreMessages.getString("ProbeDesignTask.MESSAGE_INVALID")); //$NON-NLS-1$
case VariantTarget.NOT_SET:
throw new UnsupportedOperationException(target.getID() +
CoreMessages.getString("ProbeDesignTask.MESSAGE_NO_VARIANT")); //$NON-NLS-1$
default:
throw new IllegalArgumentException("Unexpected result from Target.isValidTarget()"); //$NON-NLS-1$
}
}