Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 377380 - AbstractTree: Improve DND behaviour (allow drag without initial selection)
Summary: AbstractTree: Improve DND behaviour (allow drag without initial selection)
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-23 05:03 EDT by Beat Schwarzentrub CLA
Modified: 2021-08-19 11:07 EDT (History)
2 users (show)

See Also:
claudio.guglielmo: juno+


Attachments
SwingScoutTree.java.patch (736 bytes, application/octet-stream)
2012-04-23 05:04 EDT, Beat Schwarzentrub CLA
claudio.guglielmo: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Beat Schwarzentrub CLA 2012-04-23 05:03:45 EDT
Build Identifier: 

Given an AbstractTree widget with Drag'n'Drop enabled. When a node is selected, it can be dragged with the mouse. However, if no node is selected and the user clicks (and holds) a node, it is selected, but cannot be dragged in the same operation. The mouse button has to be released and re-pressed in order to enter the "drag" mode. This is annoying and unusual.

There used to be a bug in Swing for the same topic [1]. The problem was fixed in 2005 [2] but it still persists in Scout. The SwingScoutTree should be improved to enable the correct behaviour.

I will attach a patch proposal for the class org.eclipse.scout.rt.ui.swing.basic.tree.SwingScoutTree.P_SwingDragAndDropTransferHandler. I could not derive a reason, why the method "canDrag" should require a selection path to be present (over all, it's just about the PROP_DRAG_ENABLED flag), so I just removed that check.

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4521075
[2] http://weblogs.java.net/blog/shan_man/archive/2005/06/improved_drag_g.html

Reproducible: Always
Comment 1 Beat Schwarzentrub CLA 2012-04-23 05:04:18 EDT
Created attachment 214373 [details]
SwingScoutTree.java.patch
Comment 2 Claudio Guglielmo CLA 2012-05-23 04:12:47 EDT
Thank you Beat for the patch. It has been applied to 3.8.1.
Comment 3 Matthias Zimmermann CLA 2012-11-13 02:39:03 EST
shipped with scout juno sr1