Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding child automatically when parent is added
Adding child automatically when parent is added [message #85334] Thu, 14 December 2006 04:58 Go to next message
Eclipse UserFriend
Originally posted by: vikas.goyal.hp.com

Hi ,

Can some one please help me how to add a child element automatically
when parent element is added.

My Requirnment is like this:

<Topic>
<Subtopic>
</Subtopic>
<Topic>

I want to add Subtopic automatically within the topic when I add Topic in
the editor.

Regards,
Vikas
Re: Adding child automatically when parent is added [message #85354 is a reply to message #85334] Thu, 14 December 2006 05:20 Go to previous message
Eclipse UserFriend
Vikas Goyal a écrit :
> Hi ,
>
> Can some one please help me how to add a child element automatically
> when parent element is added.
> My Requirnment is like this:
>
> <Topic>
> <Subtopic>
> </Subtopic>
> <Topic>
>
> I want to add Subtopic automatically within the topic when I add Topic
> in the editor.
>
> Regards,
> Vikas
>
>
Hi,

I had to do that few days ago (using generation from GMF Models), and I
used Feature Seq Initializer with a Value Spec on the containment
EReference defined in Java (for example the EReference subtopics).

In the associated generated java method, I return the result of the EMF
XXXFactory.eInstance.createSubtopic() for instanciate the sub-object.

It seems to works for me, I Hope it can help you.

Greets

--
Goulwen Le Fur - goulwen.lefur@obeo.fr
Previous Topic:Programmatically create a compartment
Next Topic:datatypes vs. classes and property editing
Goto Forum:
  


Current Time: Fri May 09 08:18:45 EDT 2025

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

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

Back to the top