Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag and drop + DragTracker
Drag and drop + DragTracker [message #223386] Tue, 26 September 2006 09:43 Go to next message
Eclipse UserFriend
Originally posted by: james.willans.xactium.com

I'd like to support drag and drop between different GEF editors and also
from GEF editors to other viewers such as tree and property editors. I
would expect the CTRL key modifier to distinguish between a drag on the
same diagram and a drag from one diagram to another.

How do I go about implementing this? I can't add a
TransferDragSourceListener to the node's viewer since this invalidates the
DragEditPartsTracker used for regular moving of nodes. Can I extend
DragEditPartsTracker so that when a drop is performed in conjunction with
a CTRL modifier, data is copied to the clipboard?

Thanks,

James
Re: Drag and drop + DragTracker [message #223395 is a reply to message #223386] Tue, 26 September 2006 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

> How do I go about implementing this? I can't add a
> TransferDragSourceListener to the node's viewer since this invalidates the

Yes, you can. The drag listener should only say that it's enabled when CTRL
is being held. Of course, if CTRL key is released, you can't switch back to
the tracker.

BTW, CTRL means clone currently, so you're breaking from convention, but you
don't have many options due to the fact that DND can not be dynamically
started and stopped.

> DragEditPartsTracker used for regular moving of nodes. Can I extend
> DragEditPartsTracker so that when a drop is performed in conjunction with
> a CTRL modifier, data is copied to the clipboard?
>
> Thanks,
>
> James
>
Re: Drag and drop + DragTracker [message #223409 is a reply to message #223395] Tue, 26 September 2006 15:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: james.willans.xactium.com

Thanks Randy, that makes sense. How can I determine that the CTRL key is
being pressed in an AbstractTransferDragSourceListener?

Thanks,

James
Re: Drag and drop + DragTracker [message #223478 is a reply to message #223409] Wed, 27 September 2006 17:10 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

It should be the same as with any SWT event. Look at the modifiers mask.

"James Willans" <james.willans@xactium.com> wrote in message
news:a164d27ad6378cd976d8c48d69f63d3b$1@www.eclipse.org...
> Thanks Randy, that makes sense. How can I determine that the CTRL key is
> being pressed in an AbstractTransferDragSourceListener?
>
> Thanks,
>
> James
>
Previous Topic:Wrap the text of a Label
Next Topic:java.lang.OutOfMemoryError: Java heap space
Goto Forum:
  


Current Time: Tue Dec 12 15:53:32 GMT 2017

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

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