Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create a connection on a newly created object
Create a connection on a newly created object [message #191315] Thu, 05 June 2008 21:08 Go to next message
Eclipse UserFriend
Originally posted by: megiddo.meg-tech.com

Hello all,

I'm trying to figure out how to create a connection between two newly
created nodes. The node creation works fine, but I don't know how to get
the nodes I just created in order to use them to create the connection.

I can get the View, with the code below:
final CreateViewRequest cRequest = ...
... (create the node)
IAdaptable adapter = (IAdaptable) ((List) cRequest.getNewObject()).get(0);
View view = (View) adapter.getAdapter(View.class);

But I don't know where to go from there to get the EditPart(s) I need for
the connection. Any tips in this area would be greatly appreciated.


-Brett
Re: Create a connection on a newly created object [message #191323 is a reply to message #191315] Fri, 06 June 2008 07:06 Go to previous message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Did you already have a look on the third part of the GMF tutorial?

http://wiki.eclipse.org/GMF_Tutorial_Part_3#Custom_Actions

I think this is exactly what you need.

Regards,
Tobias



Brett schrieb:
> Hello all,
>
> I'm trying to figure out how to create a connection between two newly
> created nodes. The node creation works fine, but I don't know how to get
> the nodes I just created in order to use them to create the connection.
>
> I can get the View, with the code below:
> final CreateViewRequest cRequest = ...
> .. (create the node)
> IAdaptable adapter = (IAdaptable) ((List) cRequest.getNewObject()).get(0);
> View view = (View) adapter.getAdapter(View.class);
>
> But I don't know where to go from there to get the EditPart(s) I need
> for the connection. Any tips in this area would be greatly appreciated.
>
>
> -Brett
>
Previous Topic:Required feature 'diagram label' of 'Feature label mapping false' must be set
Next Topic:Workbench freezes on label editing (GMF 2.1 / Ganymede)
Goto Forum:
  


Current Time: Fri Apr 26 22:05:41 GMT 2024

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

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

Back to the top