Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » automatically create child nodes
icon5.gif  automatically create child nodes [message #514284] Sat, 13 February 2010 16:22 Go to next message
Dinko Ivanov is currently offline Dinko IvanovFriend
Messages: 27
Registered: July 2009
Junior Member
Hello!

In my model I have nodes with output and input ports. I want GMF editor to automatically create those ports, when the user creates a node from the palette.
I have done this in the doExecuteWithResult method of the NodeCreateCommand - I simply use the EMF factory to create them and add them to the parent. This will create the element in the model, but not the corresponding diagram element. When I start the IDE next time, there are no visual representations for the child nodes.

Please advise.

Kind Regards,
Dinko

P.S. I found a code snippet - http://wiki.eclipse.org/index.php/GMF_Tips#Creating_New_Elem ents_And_Corresponding_Views, but I don't know where to plug this code and how to integrate it.
Re: automatically create child nodes [message #514353 is a reply to message #514284] Sun, 14 February 2010 23:22 Go to previous messageGo to next message
Dinko Ivanov is currently offline Dinko IvanovFriend
Messages: 27
Registered: July 2009
Junior Member
Actually when I create the Node from the palette, the Output and Input edit parts are created but their visual representation is not persisted in the diagram file. I guess that's because they are created by the node edit part on getChildren and not by a command...

I tried to override getCreate command on my diagram edit part, but in this case the node edit part is not yet created so I cannot get the child creation command from it.

Any help would be appreciated.
Thanks,
Dinko
Re: automatically create child nodes [message #515882 is a reply to message #514353] Mon, 22 February 2010 00:51 Go to previous message
Dinko Ivanov is currently offline Dinko IvanovFriend
Messages: 27
Registered: July 2009
Junior Member
Seems to be bug in GMF generator. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=281014) After removal of the semantic hints in plugin.xml, the problem is gone.

Regards,
Dinko
Previous Topic:Disable UUIDs?
Next Topic:Font scaling problem
Goto Forum:
  


Current Time: Thu Mar 28 23:35:54 GMT 2024

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

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

Back to the top