Skip to main content



      Home
Home » Modeling » EMF » How can you change properties of attributes at runtime?
How can you change properties of attributes at runtime? [message #1860603] Mon, 21 August 2023 07:12 Go to next message
Eclipse UserFriend
Hi - I am trying to make some attributes unchangeable based on the value of another attribute. For example, if the attribute 'valueType' is DISCRETE, then only 'valueList' should become changeable. The other attributes should then not be able to be changed. If the 'valueType' is not DISCRETE, this should be the other way around.
This should be done at runtime, thus when creating an instance model of the metamodel.

index.php/fa/43422/0/

Is there any way to implement this?

Thanks in advance!
Milan
  • Attachment: emf.png
    (Size: 36.72KB, Downloaded 215 times)
Re: How can you change properties of attributes at runtime? [message #1860604 is a reply to message #1860603] Mon, 21 August 2023 08:27 Go to previous message
Eclipse UserFriend
Certainly there is no way to specify that in the Ecore model. Even in the model instance, you could change valueType after setting one more more of the other features and then you'd still have an inconsistency. In the end, you'll need to specialize the generated DesignParameterImpl' setters to constrain things, and even then, you'll have to be careful what EcoreUtil.copy does, i.e., the valueType would presumably need to be set first, which is generally the case if it's earlier in the list of EAttributes.
Previous Topic:Notification on any eContainer change
Next Topic:AbstractCDOIDLong is no longer available
Goto Forum:
  


Current Time: Mon Jun 30 23:06:27 EDT 2025

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

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

Back to the top