code-generationeclipse-emfecorexmi

use Ecore/XMI editor for instance creation from Ecore metamodel


I have a metamodel in the form of an Ecore file. I saw in some previous projects that is possible to generate an xmi file from which it is possible to edit an instance of the Ecore metamodel.

I have generated the XMI file by clicking a class in the metamodel then "Create Dynamic Instance ..." but then when I click nodes in xmi file, I miss the *new Child* command that let me to create the instance fields as in the folowing picture : enter image description here

Any idea how to solve this


Solution

  • Well, without your metamodel and more information about exactly from which root object you created your dynamic instance, it's hard to answer properly.

    Usually, if the New Child menu doesn't pop up, it's because your metaclass misses containment EReferences. The generic EMF tree editor relies on the EStructuralFeatures of each metaclass to display the various panels/menu to set information of your instances. If there is no containment references, then, no child can be created.