Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCannot create duplicate references in non-containment list
https://www.eclipse.org/forums/index.php/mv/msg/136832/431844/#msg_431844
I have a class with a non-containment list reference.
The EMF property "unique" is set to false for this reference
The EMF.Edit "Property Type" is set Editable for this reference.
The Property Sheet editor allows me to edit these references, but it does
NOT allow duplicates!
I believe the problem is in the pop-up property sheet editor, and that the
list reference itself could handle duplicates.
Any suggestions here?
Thanks in advance.
Steve]]>Steven Punte2009-07-28T06:20:24-00:00Re: Cannot create duplicate references in non-containment list
https://www.eclipse.org/forums/index.php/mv/msg/136832/431881/#msg_431881
Comments below.
Steven Punte wrote:
> I am using EMF by beginning with the ecore model and then generating
> code.
>
> I have a class with a non-containment list reference.
>
> The EMF property "unique" is set to false for this reference
>
> The EMF.Edit "Property Type" is set Editable for this reference.
>
> The Property Sheet editor allows me to edit these references, but it
> does NOT allow duplicates!
That's because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325.
A bad initial assumption was that all EObject lists had to be unique...
>
> I believe the problem is in the pop-up property sheet editor, and that
> the list reference itself could handle duplicates.
No, it can't.
>
> Any suggestions here?
You'd need to specialize the list that's created in the getter to
override isUnique to return false.
>
> Thanks in advance.
>
> Steve
>
>
>]]>Ed Merks2009-07-28T15:55:58-00:00