Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » native drag and drop
native drag and drop [message #134114] Tue, 25 May 2004 18:01 Go to next message
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!
Re: native drag and drop [message #134168 is a reply to message #134114] Tue, 25 May 2004 20:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Is this related to GEF? If not, try asking on the SWT newsgroup.
Are you downloading on a separate thread? This is pretty strange to me.


"Vivian Lo" <snipetress@yahoo.com> wrote in message
news:c90176$7sv$1@eclipse.org...
> 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!
>
>
>
Re: native drag and drop [message #134300 is a reply to message #134168] Tue, 25 May 2004 22:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snipetress.yahoo.com

I am not downloading on a separate thread.

When is event.data used by the native drop adapter?

The reason why I posted it in GEF is because of the article about drag and
drop called "Using Native Drag and Drop with GEF" on eclipse.org.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:c90b05$njv$1@eclipse.org...
> Is this related to GEF? If not, try asking on the SWT newsgroup.
> Are you downloading on a separate thread? This is pretty strange to me.
>
>
> "Vivian Lo" <snipetress@yahoo.com> wrote in message
> news:c90176$7sv$1@eclipse.org...
> > 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!
> >
> >
> >
>
>
Re: native drag and drop [message #134325 is a reply to message #134300] Wed, 26 May 2004 03:05 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Sounds like you need a win32 expert. Ask on SWT newsgroup, but I'm curious
too.

"Vivian Lo" <snipetress@yahoo.com> wrote in message
news:c90hb0$lu$1@eclipse.org...
> I am not downloading on a separate thread.
>
> When is event.data used by the native drop adapter?
>
> The reason why I posted it in GEF is because of the article about drag and
> drop called "Using Native Drag and Drop with GEF" on eclipse.org.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:c90b05$njv$1@eclipse.org...
> > Is this related to GEF? If not, try asking on the SWT newsgroup.
> > Are you downloading on a separate thread? This is pretty strange to me.
> >
> >
> > "Vivian Lo" <snipetress@yahoo.com> wrote in message
> > news:c90176$7sv$1@eclipse.org...
> > > 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:Problem with ComboBox Property Descriptor
Next Topic:Tripolar connection
Goto Forum:
  


Current Time: Sat Jul 27 16:15:14 GMT 2024

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

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

Back to the top