return new Constraint() {
@Override
public void validate(Component comp, Object value)
throws WrongValueException {
final TaskQualityFormItem item = (TaskQualityFormItem) row
.getValue();
final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
if (taskQualityForm != null) {
item.setDate((Date) value);
if (((Date) value == null)
&& (!item.isIfDateCanBeNullConstraint())) {
item.setDate(null);
throw new WrongValueException(comp,
_("date not specified"));
}
if (!assignedTaskQualityFormsToOrderElementModel
.isCorrectConsecutiveDate(taskQualityForm, item)) {
item.setDate(null);
throw new WrongValueException(
comp,
_("must be after the previous date"));
}
}