Skip to main content



      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 06:18 Go to next message
Eclipse UserFriend
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 06:19] by 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 06:05 Go to previous messageGo to next message
Eclipse UserFriend
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
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 08:58 Go to previous message
Eclipse UserFriend
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: Sun Apr 27 13:39:36 EDT 2025

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

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

Back to the top