Making a EAttribute of a EClass read-only in a Sirius model [message #1827035] |
Wed, 06 May 2020 10:18 |
Jad El-khoury Messages: 61 Registered: August 2015 |
Member |
|
|
Is there a way I can prevent the user from changing a specific attribute of an EClass in the standard Properties view? It can be even good enough if I can make it hidden.
For the Eattribute, I changed the genModel so that it's PropertyType to be Readonly. This makes the value readonly in the standard EMF editor. But Sirius does not seem to care about that.
Any other approach?
[Updated on: Wed, 06 May 2020 10:19] Report message to a moderator
|
|
|
Re: Making a EAttribute of a EClass read-only in a Sirius model [message #1827109 is a reply to message #1827035] |
Thu, 07 May 2020 10:05 |
|
Hi,
This looks like a bug. Actually, the default properties view *do* support read-only features (and make the corresponding widgets disabled), but the test we do is at the metamodel level, i.e. on EStructuralFeature.isChangeable; we currently do not consider the EMF Edit-level customizations.
Could you open a ticket for this?
In the meantime you can work around the issue by using custom properties views definitions where you can control exactly what is visible/enabled. It is not that complicated, you can "bootstrap" by importing the default rules used by Sirius ("New Properties > Import Default Properties View" on the top-level element of your .odesign) and customize just the parts you need. See https://www.eclipse.org/sirius/doc/specifier/properties/Properties_View_Description.html for more details.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.04728 seconds