Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selection and drag connection tool
Selection and drag connection tool [message #211783] Wed, 15 March 2006 21:49 Go to next message
Scott Hathaway is currently offline Scott HathawayFriend
Messages: 4
Registered: July 2009
Junior Member
I am needing a tool that will allow for not only the selection of an
EditPart but also the creation of a connection by dragging from a source
EditPart to a target EditPart. It needs to work so that single clicking
on an EditPart only selects the part but does not start connection
creation. Only when a drag occurs does the connection creation begin.

After searching this newsgroup, I tried a few different approaches
without success. First, I tried setting the drag tracker on the
SelectionTool to the ConnectionDragCreationTool. Next, I tried
implementing the getDragTracker method of my EditPart. Finally, I tried
creating my own EditPolicy for the PRIMARY_DRAG_ROLE. None of these
solutions worked very well.

Do I need to create my own tool to accomplish this task or is there an
easier way?

TIA
Re: Selection and drag connection tool [message #211823 is a reply to message #211783] Thu, 16 March 2006 00:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

So, you have no need to drag the "node" editparts? If so, It sounds like you
need to extend ConnectionDragCreationTool and modify it to include the
behavior found in SelectEditPartTracker.

"Scott Hathaway" <scott_hathaway@iwaysoftware.com> wrote in message
news:dva29m$6kg$1@utils.eclipse.org...
>I am needing a tool that will allow for not only the selection of an
> EditPart but also the creation of a connection by dragging from a source
> EditPart to a target EditPart. It needs to work so that single clicking
> on an EditPart only selects the part but does not start connection
> creation. Only when a drag occurs does the connection creation begin.
>
> After searching this newsgroup, I tried a few different approaches
> without success. First, I tried setting the drag tracker on the
> SelectionTool to the ConnectionDragCreationTool. Next, I tried
> implementing the getDragTracker method of my EditPart. Finally, I tried
> creating my own EditPolicy for the PRIMARY_DRAG_ROLE. None of these
> solutions worked very well.
>
> Do I need to create my own tool to accomplish this task or is there an
> easier way?
>
> TIA
Re: Selection and drag connection tool [message #211935 is a reply to message #211823] Thu, 16 March 2006 15:16 Go to previous message
Scott Hathaway is currently offline Scott HathawayFriend
Messages: 4
Registered: July 2009
Junior Member
Thanks Randy. I will give it a try today.


Randy Hudson wrote:
> So, you have no need to drag the "node" editparts? If so, It sounds like you
> need to extend ConnectionDragCreationTool and modify it to include the
> behavior found in SelectEditPartTracker.
>
> "Scott Hathaway" <scott_hathaway@iwaysoftware.com> wrote in message
> news:dva29m$6kg$1@utils.eclipse.org...
>> I am needing a tool that will allow for not only the selection of an
>> EditPart but also the creation of a connection by dragging from a source
>> EditPart to a target EditPart. It needs to work so that single clicking
>> on an EditPart only selects the part but does not start connection
>> creation. Only when a drag occurs does the connection creation begin.
>>
>> After searching this newsgroup, I tried a few different approaches
>> without success. First, I tried setting the drag tracker on the
>> SelectionTool to the ConnectionDragCreationTool. Next, I tried
>> implementing the getDragTracker method of my EditPart. Finally, I tried
>> creating my own EditPolicy for the PRIMARY_DRAG_ROLE. None of these
>> solutions worked very well.
>>
>> Do I need to create my own tool to accomplish this task or is there an
>> easier way?
>>
>> TIA
>
>
Previous Topic:How to force Direct Edit?
Next Topic:RTF Editor using GEF
Goto Forum:
  


Current Time: Wed Dec 07 01:16:02 GMT 2022

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

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

Back to the top