Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » native drag and drop question
native drag and drop question [message #436895] Tue, 25 May 2004 22:40
Eclipse UserFriend
Originally posted by: snipetress.yahoo.com

Hi,

I'm currently trying to drag and drop a file to outside of eclipse, so I'm
trying to implement the native drag and drop. The flow of the drag and drop
is as follows: dragStart, dragSetData, dragFinish.
To get native drag and drop to work, I need to set the data field in the
DragSourceEvent when I'm in the method DragSetData(DragSourceEvent event).

I'm running into a problem when I need to do some pre-processing in
DragSetData before actually setting the data field in the event. This is
what my dragSetData looks like:

public void dragSetData(DragSourceEvent event) {

downloadResource(); //a method that takes a long time to do
event.data = resourceLocation;
}

The problem is that when I drag an item from my view to outside of eclipse,
I have to hold the mouse to wait until the method downloadResource() is
completed first before letting go. If I let go of the mouse before
downloadResource() has completed, the drop doesn't happen(ie. the item is
not dropped to outside of eclipse).

My guess is that Windows thinks that event.data is ready to be used as soon
as I let go of the mouse, while in fact the downloading is still happening
and the event.data has not yet been set.

Here are my questions:
1. Is my guess correct?
2. If my guess is correct, how do I delay event.data to be used?

Thanks!
Previous Topic:swt application not running(very imp)
Next Topic:To make login window as plugin,pls reply
Goto Forum:
  


Current Time: Fri Sep 20 23:00:49 GMT 2024

Powered by FUDForum. Page generated in 0.03115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top