Skip to main content



      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 03:47 Go to next message
Eclipse UserFriend
Originally posted by: robert.moestl.joanneum.at

Hello!

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 #getCurrentEvent.data 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.

Greetz
Re: DND: How to get dragged item before it is dropped? [message #234081 is a reply to message #233994] Fri, 11 May 2007 01:11 Go to previous message
Eclipse UserFriend
Hi,

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:
setEnablementDeterminedByCommand(true);

Hope this helps.

Cheers,
Alex
Previous Topic:Connection creation style in GMF
Next Topic:How to use the ComboBoxCellEditor to impl dierect edit?
Goto Forum:
  


Current Time: Thu Jul 24 20:58:01 EDT 2025

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

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

Back to the top