Skip to main content



      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 07:21 Go to next message
Eclipse UserFriend
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 15:26 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: EMF - How to restrict values of non-containment references? [message #1383190 is a reply to message #1381872] Mon, 26 May 2014 04:46 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 18:28:18 EDT 2025

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

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

Back to the top