Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Cannot get DND to call dragSetData or drop(How do I get a drop in a drag-and-drop sequence enabled?)
Cannot get DND to call dragSetData or drop [message #1842746] Wed, 30 June 2021 08:05 Go to next message
Eclipse UserFriend
I am following the examples I can find online to do drag-and-drop copy from one tree element to a different place in the same tree view. I set event.doit=true in DragSourceListener#dragStart, which is being called. Calls are being made to my DropTargetListener for enter, over, and leave. When I do the drag-drop gesture in the GUI, it will show a little slashed circle (disallowed sort of icon) as I move the cursor and its selection. How do I get calls made to DragSourceListener#dragSetData and DropTargetListener#drop? What are other conditions that need to be satisfied beyond event.doit=true to make that happen?
Re: Cannot get DND to call dragSetData or drop [message #1842763 is a reply to message #1842746] Wed, 30 June 2021 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Making progress. Using one of the many OTS DropTargetAdapters solves the problem, in fact too much. The next step is to only have it call drop when the gesture to end a drop occurs (e.g., releasing the mouse button) rather than calling drop every time the cursor moves past something.
Re: Cannot get DND to call dragSetData or drop [message #1842764 is a reply to message #1842763] Wed, 30 June 2021 14:06 Go to previous messageGo to next message
Eclipse UserFriend
My mistake. It was calling validateDrop. ViewerDropAdapter won't call drop or performDrop either.
Re: Cannot get DND to call dragSetData or drop [message #1842769 is a reply to message #1842764] Wed, 30 June 2021 16:02 Go to previous message
Eclipse UserFriend
Progress. DND.DROP_COPY (=1) has no effect. The only operation that seems to be recognized is DND.DROP_MOVE (=2). Only DROP_MOVE will give a non-zero (not DND.DROP_NONE) value for the operation parameter of validateDrop. All the other DND.DROP_* values seem to get masked off and behave like DND.DROP_NONE, and a non-null operation seems to be required in addition to a true return from validateDrop. Can anyone confirm this?
Previous Topic:Dynamic plugin dependencies
Next Topic:Issue with libs of org.eclipse.jface. in Linux Platform
Goto Forum:
  


Current Time: Fri Apr 25 16:04:17 EDT 2025

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

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

Back to the top