[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Drag and Drop - dragSetData never gets called

Hi,
Can you elaborate on what the source of your problem was? I have the same problem. I have worked around it by setting my data in the dragStart() method.
In my situation I have overridden ByteArrayTransfer with a class that does nothing (all the dragging events are internal to RCP application.)


The ViewerDropAdapter.performDrop method is called correctly, and I can't find any problem there, but the dragSetData method never gets called. Something to do with my implementation of ByteArrayTransfer I suspect, but I have no idea what I did to prevent the sending of the dragsetdata event.

Thx,
evan


Thomas Piekarski wrote:
Hi.

After reading all drag and drop articles, i found out, that dragSetData is not called until the transfer of the data is requested on a drop.

So my mistake was on the drop target (handleDrop) but i was looking for a mistake in the drag source listener.

I got it working now, but i think i will need more help sooner or later ;-)


Veronika Irvine wrote:

What does MyDragSourceListener look like? What does your drop target look like?

Take a look at the following articles:

http://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html
http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html


"Thomas Piekarski" <Thomas.Piekarski.nospam@xxxxxx> wrote in message news:d01f68$go9$2@xxxxxxxxxxxxxxxxxx


Hi.

I'm trying to drag from a jface Treeviewer to a gef editor.
I'm using the following snippet to add a drag source listener:

----
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
Transfer[] transfers = new Transfer[] { TextTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new MyDragSourceListener(viewer));
----


If i start dragging a tree item, the method dragStart of the listener gets called, but dragSetData is never called.
Am i doing something wrong? Is it a bug?


Greets and thanks

Btw. i am using eclipse 3.1M4