Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Making a EAttribute of a EClass read-only in a Sirius model
Making a EAttribute of a EClass read-only in a Sirius model [message #1827035] Wed, 06 May 2020 10:18 Go to next message
Jad El-khoury is currently offline Jad El-khouryFriend
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 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
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
Re: Making a EAttribute of a EClass read-only in a Sirius model [message #1827156 is a reply to message #1827109] Fri, 08 May 2020 12:58 Go to previous message
Jad El-khoury is currently offline Jad El-khouryFriend
Messages: 61
Registered: August 2015
Member
I was creating a bug report, but it seems that there is one that describes exactly this problem from 2017.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=521994
The status is "new" although the last comment on the bug implies that it will not be fixed.
Previous Topic:Problem in opening Eclipse with Sirius projects
Next Topic:How to place context menu item at top
Goto Forum:
  


Current Time: Sat Dec 07 22:15:18 GMT 2024

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

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

Back to the top