Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Missing "new child" menu entry
Missing "new child" menu entry [message #1695045] Mon, 11 May 2015 14:57 Go to next message
Julien Delange is currently offline Julien DelangeFriend
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.
  • Attachment: emfta.ecore
    (Size: 1.86KB, Downloaded 196 times)
  • Attachment: emfta.genmodel
    (Size: 2.67KB, Downloaded 245 times)
Re: Missing "new child" menu entry [message #1695052 is a reply to message #1695045] Mon, 11 May 2015 15:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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/
Re: Missing &quot;new child&quot; menu entry [message #1695058 is a reply to message #1695052] Mon, 11 May 2015 16:03 Go to previous message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
Indeed, after looking at it, everything worked! Thanks for your help!

Julien.
Previous Topic:How to serialize ecore objects to an xml file
Next Topic:Deadlock during EPackage initialization for cyclic package interdependencies
Goto Forum:
  


Current Time: Wed Apr 24 14:59:03 GMT 2024

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

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

Back to the top