@Override
public void validate(Component comp, Object value)
throws WrongValueException {
Row row = (Row) comp.getParent();
EntitySequence sequence = (EntitySequence) row.getValue();
if (!sequence.isAlreadyInUse()) {
Integer numberOfDigits = (Integer) value;
try {
sequence.setNumberOfDigits(numberOfDigits);
} catch (IllegalArgumentException e) {
throw new WrongValueException(comp, _(
"number of digits must be between {0} and {1}",
EntitySequence.MIN_NUMBER_OF_DIGITS,
EntitySequence.MAX_NUMBER_OF_DIGITS));