Drag and Drop - dragSetData never gets called [message #451406] |
Tue, 01 March 2005 10:08 |
Eclipse User |
|
|
|
Originally posted by: Thomas.Piekarski.nospam.gmx.de
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
|
|
|
|
Re: Drag and Drop - dragSetData never gets called [message #451441 is a reply to message #451412] |
Wed, 02 March 2005 10:29 |
Eclipse User |
|
|
|
Originally posted by: Thomas.Piekarski.nospam.gmx.de
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.h tml
> http://www.eclipse.org/articles/Article-Workbench-DND/drag_d rop.html
>
>
> "Thomas Piekarski" <Thomas.Piekarski.nospam@gmx.de> wrote in message
> news:d01f68$go9$2@www.eclipse.org...
>
>>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
>
>
>
|
|
|
Re: Drag and Drop - dragSetData never gets called [message #456978 is a reply to message #451441] |
Mon, 13 June 2005 18:00 |
No real name Messages: 7 Registered: July 2009 |
Junior Member |
|
|
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.h tml
>> http://www.eclipse.org/articles/Article-Workbench-DND/drag_d rop.html
>>
>>
>> "Thomas Piekarski" <Thomas.Piekarski.nospam@gmx.de> wrote in message
>> news:d01f68$go9$2@www.eclipse.org...
>>
>>> 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
>>
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.01944 seconds