Adding child automatically when parent is added [message #85334] |
Thu, 14 December 2006 04:58  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06921 seconds