Hi
There are custom data types based on java.time.Duration, org.joda.money.Money, etc. in our metamodels. Our EFactory-class converts empty strings to nulls for such a types:
public Money createCustomMoney(final String it) {
if (it == null || it.isEmpty()) {
return null;
}
return Money.parse(it);
}
It means that if a user specifies an empty string for such an attribute, the attribute value is set to null. (By default Money.parse() throws an exception for empty strings).
Editing of such an attributes works fine in a property view. I delete attribute value and it's set to null. But when I delete value of the attribute in a table editor nothing is happens. I found that the behaviour is caused by the following class:
org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport
method:
setValue(final Object element, final Object value)
Here is a code fragment:
if (tempValue != null || isEReference(featureParent)) {
final Object finalValue = tempValue;
CellUpdater updater = editedCell.getUpdater();
if (updater != null && updater.getDirectEdit() != null) {
// Specific set
specificSetValue(editedCell, finalValue);
} else {
// Normal set
standardSetValue(line, finalValue);
}
}
If a new attribute value is null, then do nothing.
Could you please fix it? Or should I use some workaround?