Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327782

Summary: [Model Browser] New Child with EClasses from not-yet-loaded metamodels
Product: [Modeling] MoDisco Reporter: Nicolas Bros <nicolas.bros>
Component: InfrastructureAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: fabien.giquel, gdupe, hugo.bruneliere, modisco.web-inbox
Version: 0.9.0Flags: gdupe: indigo+
Target Milestone: 0.9.0 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Nicolas Bros CLA 2010-10-14 10:24:03 EDT
Currently, when doing "New Child" in the model browser, only the metaclasses from the Resources in the editor's ResourceSet are proposed.

There should be a way to load a metamodel so that instances of its EClasses can be created.
Comment 1 Nicolas Bros CLA 2010-10-14 10:48:12 EDT
I added a menu item in the "New Child" menu for loading a metamodel (in revision 3327).
Comment 2 Fabien Giquel CLA 2010-10-14 10:57:58 EDT
"New child" feature is driven by types on EReferences. So all
metaclasses referenced, and sub-metaclasses (exploring EPackage.Registry), could be automatically proposed, i think, without
explicit "load metamodel" user action (except for references to "EObject")...?
Comment 3 Nicolas Bros CLA 2010-10-14 11:37:15 EDT
I fear the list could become crowded with metaclasses from metamodels the user doesn't know or care about.
But maybe this could be solved by adding a filter that would select everything by default, and could be modified by the user to constrain the list to the subset he's interested in.
Comment 4 Gregoire Dupe CLA 2010-10-15 03:37:50 EDT
Hi,

> But maybe this could be solved by adding a filter that would select everything
> by default, and could be modified by the user to constrain the list to the
> subset he's interested in.

This filter may be a browser's preference. When the filtering would not be enable, the "Load metamodel" action should be disable or hidden.

Gregoire
Comment 5 Nicolas Bros CLA 2010-10-18 05:30:19 EDT
I modified the "New Child" menu so that it is built from all metaclasses in the EPackage.Registry. Since loading the entire EPackage.Registry takes a few seconds the first time, I made the menu even more lazy by computing the list only when the sub-menu is opened, so that the root context menu still appears quickly.

I tested it on a few models, and it seems to be working nicely. So, I don't see a need for a filtering dialog for now.

Committed in revision 3331.
Comment 6 Hugo Bruneliere CLA 2010-10-21 05:06:08 EDT
The bug has been fixed in the latest revisions.