Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Implementing Connections in Gef without having a Palette(Implementing Connections in Gef without having a Palette)
Implementing Connections in Gef without having a Palette [message #638694] Fri, 12 November 2010 09:02 Go to next message
Girish is currently offline GirishFriend
Messages: 4
Registered: June 2010
Junior Member
Hi Freiends

I've read many tutorials for implementing connections but every ttorial i read have connection entry in the palette on select of that the connection is created

I'm thinking of implementing the connections on drag and drop

its something like selecting a source node and dropping on the target node then the connection should appear,
I think this can be implemented but need some guidance
can you please help me in achieving this or else if any document that talks bout this

and i like to have my own connection figure (which should have some other Figure as Child )

Thanks in advance
Re: Implementing Connections in Gef without having a Palette [message #638723 is a reply to message #638694] Fri, 12 November 2010 11:00 Go to previous message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 100
Registered: March 2010
Location: Hyderabad
Senior Member

Regarding creating connections using drag and drop you can try this.
install the below edit policy on the node.

		installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {
			protected Command getCreateCommand(CreateRequest request) {
				return null;
			protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
				return null;
			protected Command getAddCommand(Request request) {
				List<?> editParts = ((ChangeBoundsRequest) request).getEditParts();
				if (editParts.size() == 1) {
                  Object source = editParts.get(0);
                  Object target = getHost();
                  // Return a connection creation command using source and target edit parts
				return null;


Previous Topic:How/when to show popup menu on connection creation?
Next Topic:How can I have a Draw2d button event start a request ?
Goto Forum:

Current Time: Tue Apr 24 16:30:52 GMT 2018

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

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