Bug 288222 - Feature request for DragSourceListener
Summary: Feature request for DragSourceListener
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-01 04:05 EDT by Rencana Tarigan CLA
Modified: 2019-09-06 16:04 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rencana Tarigan CLA 2009-09-01 04:05:34 EDT
I want to request an enhancement to detect location where we drop a file from application to local file system.

Thanks,
Comment 1 Juergen Baier CLA 2010-08-24 05:28:12 EDT
This feature would solve quite some problems I currently have with drag-and-drop. With some guidance, I would be willing to make the needed effort to contribute this enhancement to SWT.

Taking a deep look at the source, its difficult for me to so see where to find the drop-location. Has anybody some hint for that? How about having the drop-location available in the event-object passed to dragFinished() ? There it would be possible to work with the information further on.
Comment 2 Felipe Heidrich CLA 2010-08-31 10:42:25 EDT
I'm not sure I undertood the problem.

From the DragSource side you want to know who the DropTarget is ?
What would that API look like ?
Comment 3 Juergen Baier CLA 2010-08-31 11:07:09 EDT
The information that is not accessible to me is the path (for a FileTransfer) to which a file was dragged to (path in the operating-system, outside of my Eclipse RCP).

The actual problem is:

I have a table that shows a list of (virtual) files, these files are stored on a server. It is possible to drag these files from the table to the local filesystem to copy them to that location.

This works partly. When the drag starts, I can download the dragged file to a local tmp-folder and set the path to the local file in the dragSetData(..)-method. So far, everything is fine for small files, that are completely downloaded when the user drops the file. Here is a scheme of the dragSetData:

public void dragSetData(DragSourceEvent event) {
    event.data = downloadFile(currently_selected_file);
}

Now, for some larger files, this does not work, because the files are already copied from the tmp-location to the drop-target when the user releases the mouse-button (for larger files that is then before they are completely downloaded).

My solution for that: if I knew the path where the user has dropped the file to (for example the desktop), I can initiate the copy of the file myself to that destination after the download is complete. But, I am currently not able to get this information (the drop-target-path for the FileTransfer).

It would be great if this information is available e.g. in the event-object at the dragFinished-method:

public void dragFinished(DragSourceEvent event) {
    drop_target_path = event.data;
    copy_currently_selected_file_after_download(drop_target_path);
}

Any help there is greatly appreciated.
Comment 4 Felipe Heidrich CLA 2010-09-03 10:12:36 EDT
Juergen Baier, see Bug 196176. Is that what you need ?
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:04:11 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.

If you have further information on the current state of the bug, please add it. 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.