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 07:21 Go to next message
Matthias Freund is currently offline Matthias Freund
Messages: 2
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 15:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25949
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
>
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
Matthias Freund is currently offline Matthias Freund
Messages: 2
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: Fri Aug 01 12:13:14 EDT 2014

Powered by FUDForum. Page generated in 0.01984 seconds