Missing "new child" menu entry [message #1695045] |
Mon, 11 May 2015 14:57 |
Julien Delange Messages: 82 Registered: October 2011 |
Member |
|
|
Hello,
I am trying to make a simple model with the editor and then, later, make a sirius editor. I have a big issue: when generating the model code with edit/editor code, I do not have the "New Child" menu item in my eclipse environment (or even "new Sibling").
I tried to have a look at my genfile or model code but did not find anything relevant. In fact, the references appears in the component attributes but clearly not as a child. For example, in this model, I would like to be able to add a gate as a child of a tree or also sub-events to an event.
But when generating the code, when creating a tree as a root object, I cannot create child, either for a Tree or Gate object. Any idea why I do not have the "new Child" menu?
I attached the genmodel and ecore files if anybody can provide help.
Julien.
|
|
|
Re: Missing "new child" menu entry [message #1695052 is a reply to message #1695045] |
Mon, 11 May 2015 15:41 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Julien,
Comments below.
On 11/05/2015 4:57 PM, Julien Delange wrote:
> Hello,
>
> I am trying to make a simple model with the editor and then, later, make a sirius editor. I have a big issue: when generating the model code with edit/editor code, I do not have the "New Child" menu item in my eclipse environment (or even "new Sibling").
Likely because there are no containment references...
>
> I tried to have a look at my genfile or model code but did not find anything relevant. In fact, the references appears in the component attributes but clearly not as a child. For example, in this model, I would like to be able to add a gate as a child of a tree or also sub-events to an event.
Is it a containment reference?
>
> But when generating the code, when creating a tree as a root object, I cannot create child, either for a Tree or Gate object. Any idea why I do not have the "new Child" menu?
Note that if you change a non-containment reference to a containment
reference after already having created a GenModel, the GenFeature
properties for that EReference will not be updated to set the
appropriate properties to support child creation. That looks like
what's probably happened, e.g., Tree's "gate" feature has createChild
set to false...
<genClasses ecoreClass="emfta.ecore#//Tree">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
emfta.ecore#//Tree/name"/>
<genFeatures notify="false" createChild="false"
propertySortChoices="true" ecoreFeature="ecore:EReference
emfta.ecore#//Tree/gate"/>
</genClasses>
You might try deleting your *.genmodel and creating a new one, or
setting the properties "properly".
>
> I attached the genmodel and ecore files if anybody can provide help.
>
> Julien.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03639 seconds