Make grid cell only editable, if condition meets in data in that row, valid


Vaadin 8
There is a table, which is filled from existing data, but can be new rows added.
If the row contains existing data, then only some of the cells should be editable, others are not.

Currently i’ve achieve something like this with this code: .bind(InventoryControlMovementEntity::getData, (entity, s) -> { if (entity.getOrigMe1qty().signum()==0) entity.setData(s); else Notification.warningNotification("warn.noteditable","data");}));

So the setter is only invoked, if the condition is true. But this is not an elegant way, i want this cell to be not editable at all,

My other problem is, that i’ve made a custom validator which checks a Set if it contains the string written to the cell. If it’s true, and shows validation message.
But this happens if the cell data isn’t changed, so it’s an existing data, where it shouldn’t be checked.
.withValidator(v -> !existingStrings.contains(v),"Exists already!")