Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF - How to restrict values of non-containment references?
EMF - How to restrict values of non-containment references? [message #1381082] Sun, 25 May 2014 11:21 Go to next message
Matthias Freund is currently offline Matthias FreundFriend
Messages: 8
Registered: May 2014
Junior Member
Hi all,

in my metamodel, I have defined an EClass with a non-containment reference. If I instantiate a model and use the "Properties" view to set a value for this reference, the drop-down list displays all existing instances of the type of the reference as possible values.

Now, I want to restrict the values shown by an additional algorithm. Where can I implement this algorithm? As far as I understand EMF, this should be done in the "edit" part of the generated code but I cannot seem to find the right place. Which is the method that is called by the "Properties" view to retrieve all possible matches?

Or is there any possibility to implement such additional constraints for reference values in the "model" part of the generated code?

Thanks in advance!
Matthias
Re: EMF - How to restrict values of non-containment references? [message #1381872 is a reply to message #1381082] Sun, 25 May 2014 19:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
http://wiki.eclipse.org/EMF/FAQ#How_can_I_control_which_instances_are_available_as_choices_when_editing_a_property_in_the_properties_view.3F

On 25/05/2014 5:39 PM, Matthias Freund wrote:
> Hi all,
>
> in my metamodel, I have defined an EClass with a non-containment
> reference. If I instantiate a model and use the "Properties" view to
> set a value for this reference, the drop-down list displays all
> existing instances of the type of the reference as possible values.
>
> Now, I want to restrict the values shown by an additional algorithm.
> Where can I implement this algorithm? As far as I understand EMF, this
> should be done in the "edit" part of the generated code but I cannot
> seem to find the right place. Which is the method that is called by
> the "Properties" view to retrieve all possible matches?
>
> Or is there any possibility to implement such additional constraints
> for reference values in the "model" part of the generated code?
>
> Thanks in advance!
> Matthias
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF - How to restrict values of non-containment references? [message #1383190 is a reply to message #1381872] Mon, 26 May 2014 08:46 Go to previous message
Matthias Freund is currently offline Matthias FreundFriend
Messages: 8
Registered: May 2014
Junior Member
Hi Ed,

thanks for the hint! Works like a charm...

Kind regards,
Matthias
Previous Topic:New EClass instance validation
Next Topic:[CDO] Question about locking
Goto Forum:
  


Current Time: Thu Apr 25 04:21:38 GMT 2024

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

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

Back to the top