Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Cannot create duplicate references in non-containment list
Cannot create duplicate references in non-containment list [message #431844] Tue, 28 July 2009 06:20 Go to next message
Steven Punte is currently offline Steven PunteFriend
Messages: 34
Registered: July 2009
Member
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!

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
Re: Cannot create duplicate references in non-containment list [message #431881 is a reply to message #431844] Tue, 28 July 2009 15:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Steven,

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 Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Controlling XML URI resolution
Next Topic:Instance of EList
Goto Forum:
  


Current Time: Tue Apr 23 12:58:09 GMT 2024

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

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

Back to the top