Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Nullable cells in table editor
Nullable cells in table editor [message #1834762] Tue, 17 November 2020 13:31
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 343
Registered: August 2013
Senior Member
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?
Previous Topic:Delete root element of diagram does not delete the diagram from aird file
Next Topic:Nesting Sirius Projects
Goto Forum:
  


Current Time: Thu Mar 28 22:11:24 GMT 2024

Powered by FUDForum. Page generated in 0.02255 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top