Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330149 - Containers of more than one reference don't display in generated tree model editor
Summary: Containers of more than one reference don't display in generated tree model e...
Status: RESOLVED WORKSFORME
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 16:25 EST by Glenview Jeff CLA
Modified: 2010-11-14 19:47 EST (History)
1 user (show)

See Also:


Attachments
A working example (37.80 KB, application/x-itunes-itlp)
2010-11-14 19:46 EST, Ed Merks CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Glenview Jeff CLA 2010-11-12 16:25:55 EST
Build Identifier: 

I'm only using EMF and its generated tree editor.

Here's a summary of my EMF meta-model:

- EClass: Widget
  - name

- EClass: WidgetReference
  - aWidgetReference : Widget [0..1] Containment = false

- EClass: WidgetContainer
  - myWidgets : Widget [0..*] Containment = true

- EClass: ReferenceContainer
  - myReferences : WidgetReference [0..*] Containment = true

- EClass: TopLevelClass
  - myWidgetContainer    : [1] WidgetContainer    Containment = true
  - myReferenceContainer : [1] ReferenceContainer Containment = true

What's happening now is that in the generated tree editor for the model, I create everything starting from the TopLevelClass. I can successfully create multiple widgets in the WidgetContainer, and I can create a single WidgetReference in the ReferenceContainer and associate it with a specific Widget.

In case anyone runs into this, there is a bug in the generated EMF editor code:

When I try to add more than one WidgetReference to the ReferenceContainer, the tree editor only shows the first WidgetReference under the ReferenceContainer. If I click on the WidgetReferences item in the tree, it does show multiple WidgetReferences in the properties view. It just won't let me see them in the tree, and therefore won't let me select them to change their reference to associate it to an actual widget.

The workaround to this is to create as many references as you need, save and close the model, and then re-open it. Upon re-opening it, all of the references will be shown.

Thanks for any help/guidance.

Jeff


Reproducible: Always

Steps to Reproduce:
Recreate meta-model and model described in bug-report details.
Comment 1 Ed Merks CLA 2010-11-14 19:46:58 EST
Created attachment 183098 [details]
A working example
Comment 2 Ed Merks CLA 2010-11-14 19:47:40 EST
The attached example works as expected, so I can't reproduce the problem you describe.  In the future, please attached an actual example rather than just a verbal description.