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: 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 05:11 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
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: Tue Mar 19 07:11:39 GMT 2024

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

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

Back to the top