Node provisionning [message #218813] |
Fri, 13 February 2009 11:18  |
Eclipse User |
|
|
|
Hello,
I need to find a way to provision my diagram with data : ie create Nodes
by importing a file or a database. Then be able to use those nodes in my
diagram (as if I had created them from the palette).
I Managed to import some nodes with that code :
http://pastebin.com/m74acf879
This works, I got my nodes on my diagram.
Then I have to modify some properties of my newly created nodes to math
the file I import :
http://pastebin.com/m216568ce
But it only modifies the values of one node :
If I import a file with two nodes, it will modify the first created node
on the diagram with the values of the first node in the file, but then
it will modify the same node with the second value in the file...
It seems that it doesn't iterate over the elements.
What did I miss ?
Thanks.
|
|
|
Re: Node provisionning [message #218830 is a reply to message #218813] |
Fri, 13 February 2009 11:47  |
Eclipse User |
|
|
|
Le 13/02/2009 17:18, Rodolphe Beck a écrit :
> Hello,
>
> I need to find a way to provision my diagram with data : ie create Nodes
> by importing a file or a database. Then be able to use those nodes in my
> diagram (as if I had created them from the palette).
>
> I Managed to import some nodes with that code :
>
> http://pastebin.com/m74acf879
>
> This works, I got my nodes on my diagram.
>
> Then I have to modify some properties of my newly created nodes to math
> the file I import :
>
> http://pastebin.com/m216568ce
>
> But it only modifies the values of one node :
>
> If I import a file with two nodes, it will modify the first created node
> on the diagram with the values of the first node in the file, but then
> it will modify the same node with the second value in the file...
>
> It seems that it doesn't iterate over the elements.
>
> What did I miss ?
>
> Thanks.
Ok, I used the other method :
http://wiki.eclipse.org/index.php/GMF_Tips#Create_New_Elemen ts_Using_RecordingCommand_and_CanonicalEditPolicies
It works perfectly now :)
|
|
|
Powered by
FUDForum. Page generated in 0.49318 seconds