Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DND: How to get dragged item before it is dropped?
DND: How to get dragged item before it is dropped? [message #233994] Wed, 09 May 2007 07:47 Go to next message
Eclipse UserFriend
Originally posted by:


Is it possible to find out which object is dragged before it is dropped?

I want to give the user feedback by the cursor, if dragged object can be
dropped on the targeted editor. Therefore I thought that #handleDragOver
of class AbstractTransferDropTargetListener would be a good place to
do so. Unfortunately in this state is always null.

As a workaround I have overwritten #isEnabled(DropTargetEvent event).
When the user now drops an object which is not allowed to be dropped
simply nothing happens. But in my opinion it would be more user friendly
when the cursor indicates whether the current action is allowed or not.

Re: DND: How to get dragged item before it is dropped? [message #234081 is a reply to message #233994] Fri, 11 May 2007 05:11 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member

You can try overriding AbstractTransferDropTargetListener#isEnabled() on
your drop target listener if it doesn't do the job for you. Also, you
could try drive the enable/disable drag from the command created for the
drag and I'd recommend this approach:
AbstractTransferDropTargetListener#setEnablementDeterminedBy Command(boolean).
Just put the following when you constract your drop target listener:

Hope this helps.

Previous Topic:Showing feedback based on target part
Next Topic:palette event
Goto Forum:

Current Time: Mon Aug 15 17:13:38 GMT 2022

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

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

Back to the top