Bug 493853 - [Properties] NattablePropertyEditor illegally modifies its configuration model
Summary: [Properties] NattablePropertyEditor illegally modifies its configuration model
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Views (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X
: P2 normal (vote)
Target Milestone: 2.0.0   Edit
Assignee: Christian Damus CLA
QA Contact:
URL: https://dev.eclipse.org/mhonarc/lists...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 17:54 EDT by Christian Damus CLA
Modified: 2016-05-18 13:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2016-05-17 17:54:37 EDT
May 17 2016 build of Papyrus Neon

When the NattablePropertyEditor initializes the table instance in the workspace metadata area, under one particular circumstance it will attempt to modify the table-configuration model that defines it.  This is invalid for two reasons:

* when the table is first being created, the table's private editing domain in which it loaded the configuration model does not have a read/write transaction, so the modification throws an IllegalStateException that prevents the creation of the actual table widget

* the table editor should not be attempting to modify its configuration model, anyways.  This configuration is a static model deployed in a plug-in bundle

The problem is in the protected Table createTable(EObject, EStructuralFeature) method, here:

	if (null != synchronizedFeature) {
		TableHeaderAxisConfiguration rowHeaderAxisconfig = tableConfiguration.getRowHeaderAxisConfiguration();
		for (IAxisConfiguration axisConfig : rowHeaderAxisconfig.getOwnedAxisConfigurations()) {
			if (axisConfig instanceof EStructuralFeatureValueFillingConfiguration) {
				((EStructuralFeatureValueFillingConfiguration) axisConfig).setListenFeature(synchronizedFeature);
			}
		}
	}

It's the setListenFeature(...) call that's invalid.  The editor should just trust that the configuration model already references the 'synchronizedFeature' as the "listen feature" of the axis configuration, because it wouldn't make any sense for it to be a different feature.

Steps to reproduce:

You can either go the hard way and create a table-configuration model that includes an EStructuralFeatureValueFillingConfiguration in its row header axis configuration and use that configuration in a new property sheet widget cooked up for some UML metaclass (with all of the attendant environment and context models and XWT files) or you can check out patch set 25 of Gerrit review 66384 into a Papyrus-RT workspace:

    git fetch https://<user>@git.eclipse.org/r/a/papyrus-rt/org.eclipse.papyrus-rt refs/changes/84/66384/25 && git checkout FETCH_HEAD

and try to see the properties of a protocol message in the "Real Time" tab.
Comment 1 Christian Damus CLA 2016-05-17 20:10:07 EDT
This is a priority for the Papyrus-RT 1.0 release.
Comment 2 Eclipse Genie CLA 2016-05-18 00:02:23 EDT
New Gerrit change created: https://git.eclipse.org/r/72993
Comment 4 Christian Damus CLA 2016-05-18 13:27:12 EDT
(In reply to Eclipse Genie from comment #3)
> Gerrit change https://git.eclipse.org/r/72993 was merged to [master].