Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to create a node programmaticaly?
how to create a node programmaticaly? [message #673992] Wed, 25 May 2011 13:00 Go to next message
fenrir  is currently offline fenrir Friend
Messages: 15
Registered: April 2011
Location: France
Junior Member
Hi,

I want to create a node automaticaly when another node is created.
But the problem is that I don't really know where I have to create it... I tried to modify the classes "MyClassImpl" and the "MyClassEditPart" to create the new node, but nothing changed.
(I created the other elements in constructors but I don't know how to add the node in the model and in the diagram)
What have I to modify to get this fonctionnality? Does anybody have an example of the code I have to put?

Thanks in advance,

Fenrir

[Updated on: Wed, 25 May 2011 13:08]

Report message to a moderator

Re: how to create a node programmaticaly? [message #676130 is a reply to message #673992] Thu, 02 June 2011 22:30 Go to previous messageGo to next message
Joao S is currently offline Joao SFriend
Messages: 51
Registered: January 2011
Member
Greetings!

Why don´t you try to override that nodes create command?

You should have a method there called doExecutWithResult.

Take a look at it.

Best regards
Joao
Re: how to create a node programmaticaly? [message #676734 is a reply to message #676130] Mon, 06 June 2011 11:21 Go to previous messageGo to next message
fenrir  is currently offline fenrir Friend
Messages: 15
Registered: April 2011
Location: France
Junior Member
I did it, but the problem was that created the node only in the model, no editpart was created.
I managed to do my project without this functionnality, so this is not an urgent problem but I'm interested if anybody has the solution, I'm curious ^^.
Re: how to create a node programmaticaly? [message #676771 is a reply to message #676734] Mon, 06 June 2011 13:24 Go to previous message
Joao S is currently offline Joao SFriend
Messages: 51
Registered: January 2011
Member
Hello again,

I really don´t know.

Have you checked if ViewProvider was being called?

Best Regards,
Joao
Previous Topic:Can I change compartment positions
Next Topic:Visual ID inconsistency after ecore namespace URI change
Goto Forum:
  


Current Time: Wed Apr 24 13:54:52 GMT 2024

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

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

Back to the top