use of org.eclipse.scout.rt.platform.exception.ProcessingStatus in project scout.rt by eclipse.
the class AbstractDateField method validateValueInternal.
@Override
protected Date validateValueInternal(Date rawValue) {
rawValue = super.validateValueInternal(rawValue);
if (rawValue == null) {
return null;
}
// Check if date is allowed (if allowed dates are set)
if (getAllowedDates().size() > 0) {
Date truncDate = DateUtility.truncDate(rawValue);
boolean found = false;
for (Date allowedDate : getAllowedDates()) {
if (allowedDate.compareTo(truncDate) == 0) {
found = true;
break;
}
}
if (!found) {
throw new VetoException(new ProcessingStatus(TEXTS.get("DateIsNotAllowed"), IStatus.ERROR));
}
}
return rawValue;
}
Aggregations