Bug 22274 - [DND] Navigator should not sync selection with editor on drag
Summary: [DND] Navigator should not sync selection with editor on drag
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 2.1.3   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 26105 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-08 14:16 EDT by Randy Hudson CLA
Modified: 2004-03-05 11:43 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2002-08-08 14:16:37 EDT
If I have two resources A and B open in their editors, and I try to drag A into 
B from the navigator view, I cannot.  The navigator will flip the active active 
editor to A, making it impossible to drop on B.

It is possible to avoid this by checking the dragsourceevent.doit value during 
the dragStart callback, and storing this value until the drag finished callback 
has occurred.  If it is true, then a native drag is about to start.  The 
mousedown or selection event should come after the dragStart event, and "Link 
navigator selection to active Editor" can be suppressed.
Comment 1 Randy Hudson CLA 2002-08-27 17:09:55 EDT
I think I was wrong about event order. I believe MouseDown, and also Selection 
events will both fire before DragStart. Good luck.
Comment 2 Knut Radloff CLA 2002-08-30 11:08:06 EDT
I don't think the editors are even drop targets. What do you envision dropping 
a resource into an editor should do? Append the contents or replace it?
We could support this by making a drag over the editor tab switch to that 
editor. 
I doubt this feature is particularly useful though. Marking as won't fix.
Comment 3 Randy Hudson CLA 2002-08-30 11:23:18 EDT
How do you know if Editor's are drop targets?

*TONS* of editors are drop targets in WSAD.  For example, dragging a .GIF file 
into a web page creates an <IMG> tag with that .GIF file.  Or dragging another 
HTML file into an HTML file might create a link.
Comment 4 Knut Radloff CLA 2002-08-30 11:41:40 EDT
We should make the editor tabs drop targets then and check if the editor would 
accept the drop operation if possible.
Comment 5 Randy Hudson CLA 2002-08-30 15:51:35 EDT
> We should make the editor tabs drop targets then and check if the editor
> would accept the drop operation if possible.

Are you saying that it is impossible to avoid flipping pages, and you recommend 
this as a workaround to get back to the correct page?

I agree that EditorPane and probably stacked views (and maybe the shortcut bar) 
should all flip to the appropriate tab/perspective/quickview for drag and drop 
support, but this is a separate bug.  The issue of this bug is that the User's 
context is lost when they try to drag a resource from the Navigator View.  The 
Navigator will flip Editors even though the user did not desire to open that 
resource.
Comment 6 Knut Radloff CLA 2002-09-06 14:11:54 EDT
Editors are switched on mouse up so it should be possible to avoid switching.
Comment 7 Knut Radloff CLA 2002-11-13 15:01:09 EST
*** Bug 26105 has been marked as a duplicate of this bug. ***
Comment 8 Knut Radloff CLA 2003-05-16 17:09:45 EDT
Randy is correct, the Selection event is sent before DragStart.
When the selection event is received we can run the linking part of the 
selection handling asynchronously to wait for the drag event. When the async 
runs the drag will have been noted by the navigator and the linking will be 
ignored.
This is not elegant but it's also not horrible and would fix the problem with 
low impact. The alternative would be for SWT to send the drag event before 
sending the selection event. Changing event order is a bad idea and is not 
feasible.
Comment 9 Randy Hudson CLA 2003-05-17 11:06:30 EDT
What about waiting for mouseUp event?  mouseUp events never occur once native 
DND begins.
Comment 10 Knut Radloff CLA 2003-05-19 14:55:36 EDT
I'm using DragDetect now which is more explicit than MouseUp for this scenario. 
I released a fix to HEAD on the 16th.
Comment 11 Michael Van Meekeren CLA 2004-03-04 14:28:54 EST
Verified in R2.1.3RC2 on MOTIF.  Dragging file A does not cause the editor for A
to come to focus before starting or during the drag.
Comment 12 Nick Edgar CLA 2004-03-04 23:23:53 EST
Verified that this is fixed in the Navigator on Windows 2000 using 2.1.3RC2.
Problem still occurs in the Package Explorer though.  Is this needed for 2.1.3?
Comment 13 Chris McLaren CLA 2004-03-05 11:43:23 EST
verified on mac on 2.1.3 RC2.
problem doesn't occur on navigator or package explorer for me. (package explorer does throw up a very quick dialog - 'in progress', or something - on drop, but doesn't activate the other editor)