Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:12 Go to next message
Milan Cornelis is currently offline Milan CornelisFriend
Messages: 1
Registered: August 2023
Junior Member
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 106 times)
Re: How can you change properties of attributes at runtime? [message #1860604 is a reply to message #1860603] Mon, 21 August 2023 12:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
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.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Notification on any eContainer change
Next Topic:AbstractCDOIDLong is no longer available
Goto Forum:
  


Current Time: Thu May 02 06:02:23 GMT 2024

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

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

Back to the top