Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 182246

Summary: [DND] Drag and drop does not work if started on non-char area
Product: [Eclipse Project] Platform Reporter: Michel D. <ninharsag>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Kevin Barnes <cocoakevin>
Severity: minor    
Priority: P3 CC: daniel_megert, duongn, rymo81, snorthov
Version: 3.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Michel D. CLA 2007-04-12 19:12:12 EDT
Build ID: I20070323-1616

Steps To Reproduce:
1. Copy/paste in your editor the text below :

while (true) {
                                            
                                            
                                               
                                             
                                           
                                          
} // end

2. Select this text in your editor.
3. Put your mouse pointer at the very right of the selected text and try to drag the text.
4. Nothing happen.

More information:
It's impossible to drag 'n drop text in the editor when you begin to drag where there is an empty space at the "right" of a selected text (java, xml, etc ...), but it's possible when you are at the left/beginning of the text.

(Eclipse I20070323-1616 and N20070412-0010)
Comment 1 rymo CLA 2007-10-18 21:55:29 EDT
It seems to me that selecting the left side doesn't always work either.  Even in the case of a small section of text without whitespace, the selection will not drag properly when attempting to grab the first character.  Attempting to grab the left-most part of this first character results in a new selection being made (perhaps acceptable behavior, but see below).  Grabbing the middle or right half of the same character does not allow drag-and-drop, nor does it attempt to start a new selection (unexpected behavior).  This effect can be produced with a selection as small as two adjacent characters.

Also, most other implementations of drag and drop support that I'm familiar with allow drag of a single-character selection.  Is there reason not to provide the same behavior within Eclipse?

Possibly a separate issue: initiating a drag but dropping back in the original location leaves the text unchanged as expected, but cancels the selection; a successful drop in a new location retains the selection.  For instance, in a Firefox edit box, dropping the text on itself shows a circle-slash "no" indicator, and on mouse-up the selected text remains highlighted.  This seems to be a fairly standard behavior in editors I'm familiar with, along with the pointer changing to an arrow when hovering over a text selection - differentiating a readiness for drag-and-drop from the vertical bar indicating drag-to-select.

This last bit might deserve a separate feature request?
Comment 2 Dani Megert CLA 2007-10-24 06:14:35 EDT
>Also, most other implementations of drag and drop support that I'm familiar
>with allow drag of a single-character selection
I've fixed this in HEAD.

Please do not report different things in one bug report. This one is about DnD broken when starting over non-char selection. I was not able to reproduce the other scenario you mentioned.

The initially reported problem can be reproduced on plain StyledText: instead of starting the drag operation  the selection is cleared.

Moving to SWT.
Comment 3 Leo Ufimtsev CLA 2017-08-03 12:28:01 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 4 Eclipse Genie CLA 2020-04-09 14:05:04 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.