Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 34335 - DND doesn't work
Summary: DND doesn't work
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 2.1 RC3   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 34640 35023 35031 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-10 11:06 EST by Jared Burns CLA
Modified: 2003-03-21 09:18 EST (History)
6 users (show)

See Also:


Attachments
Patch that fixes the problem (15.96 KB, patch)
2003-03-13 13:50 EST, Dirk Baeumer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2003-03-10 11:06:53 EST
RC2
Linux-GTK

Drag and drop doesn't work. I've tried it in the DNDExample and in the package
explorer and drags are never initiated.
Comment 1 Veronika Irvine CLA 2003-03-10 12:49:00 EST
In the DNDExample, you have to check off "DragDetect hooked" and "DropTarget 
registered".

I will fix the example to make it more clear.

This worked for me on RedHat 8.0 in Gnome.  What are you using?
Comment 2 Jared Burns CLA 2003-03-10 14:30:43 EST
Ok. If I check those two options, the example works. However, DND in the
package explorer has still gone missing. Should I reassign to JDT UI?
Comment 3 Veronika Irvine CLA 2003-03-10 15:19:23 EST
I think it is a result of:

http://dev.eclipse.org/bugs/show_bug.cgi?id=30543
Comment 4 Knut Radloff CLA 2003-03-10 17:49:50 EST
The fix for bug 30543 should not prevent DND within the package explorer.
This does not work for me either. There is no drag feedback. Works fine in the 
Navigator.
Comment 5 Veronika Irvine CLA 2003-03-11 07:30:40 EST
Moving to JDT UI since the problem seems to be with the Package Explorer.
Comment 6 Dirk Baeumer CLA 2003-03-13 07:42:58 EST
PackageExplorer is missing the call to DragSource.setTransfer. This is OK 
under Windows but not under Linux-GTK.
Comment 7 Dirk Baeumer CLA 2003-03-13 09:57:13 EST
Same happens under Linux-Motif
Comment 8 Dirk Baeumer CLA 2003-03-13 11:13:40 EST
*** Bug 34640 has been marked as a duplicate of this bug. ***
Comment 9 Dirk Baeumer CLA 2003-03-13 11:21:36 EST
There is another bug that prevents DnD from working as soon as a member was 
draged. The package explorer contains code that resets the transfer types to 
selection transfer only as soon as the user drags a method.

for (Iterator iter= selection.iterator(); iter.hasNext(); ) {
	if (iter.next() instanceof IMember) {
  	  setPossibleListeners(new TransferDragSourceListener[] {new 
SelectionTransferDragAdapter(fViewer)});
	  break;
	}
}


The problem is that DnD is only initialized on creation time of the package 
explorer hence dragging a method disables DnD for resouce and file transfer as 
long as the package explorer exists.

Adam, can you please comment on this code since I believe it went in when we 
enabled DnD for members. 
Comment 10 Adam Kiezun CLA 2003-03-13 12:22:08 EST
Dirk, this code was introduced by you as a part of fix for bug 12585
(i found it by looking at the resource history of the file - see revision 1.108)
Comment 11 Dirk Baeumer CLA 2003-03-13 12:42:17 EST
Thanks !
Comment 12 Adam Kiezun CLA 2003-03-13 12:51:45 EST
btw, same code sits in JavaBrowsingPart too
Comment 13 Dirk Baeumer CLA 2003-03-13 12:59:21 EST
Already detected it. 

There are some inconsistencies regarding DnD. I opened a separate PR for it 
(see bug 34934)
Comment 14 Dirk Baeumer CLA 2003-03-13 13:50:22 EST
Created attachment 4107 [details]
Patch that fixes the problem
Comment 15 Dirk Baeumer CLA 2003-03-14 10:56:16 EST
Fixed for RC3. Reviewed by Adam Kiezun.  
Comment 16 Randy Hudson CLA 2003-03-14 11:23:54 EST
Does anyone recall that GEF copied the implementation of DelegatingDragSource?  
Oh well, we just finished re-living the same problems. Knut, maybe platform-ui 
should reconsider adopting these classes for 2.2.
Comment 17 Randy Hudson CLA 2003-03-14 11:24:36 EST
*** Bug 35023 has been marked as a duplicate of this bug. ***
Comment 18 Knut Radloff CLA 2003-03-14 15:00:51 EST
Bug 10146 is still open. I definitely want to look into taking these for 2.2.
The current NavigatorDropAdapter seems less than ideal. I just need to look 
into what it takes to switch it to a delegating adapter.
Comment 19 Dirk Baeumer CLA 2003-03-17 03:24:03 EST
*** Bug 35031 has been marked as a duplicate of this bug. ***
Comment 20 Dirk Baeumer CLA 2003-03-21 09:18:51 EST
Verified for RC3 by Andre Weinand