Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » DND problem
DND problem [message #170678] Mon, 15 December 2003 17:37 Go to next message
Eclipse UserFriend
Originally posted by: arteksmartek.go2.pl

I spent 4 hours and finally I given up :(
here is the problem:

I have TableViewer and TreeViewer, and I defined DND operations as follows:
---------
private class DragAdapter extends DragSourceAdapter {
public void dragSetData(DragSourceEvent event) {
event.data = tableViewer.getSelection();
System.out.println("dragData: " + event.data);
}

Transfer[] transfers = new Transfer[] {
LocalSelectionTransfer.getInstance() };
tableViewer.addDragSupport(DND.DROP_MOVE, transfers, new DragAdapter());
---------
private class DropAdapter extends DropTargetAdapter {
public void drop(DropTargetEvent event){
System.out.println("dropData: " + event.data);
}
}
Transfer[] transfers = new Transfer[] {
LocalSelectionTransfer.getInstance() };
treeViewer.addDropSupport(DND.DROP_MOVE, transfers, new DropAdapter());
---------

after performing DND operation the result is:
dragData: [xxx, yyy, etc...]
dropData: null

why the data in event object is null ?
what did I miss ?
please help

thanks in advance

Artur
Re: DND problem [message #170698 is a reply to message #170678] Mon, 15 December 2003 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arteksmartek.go2.pl

ok, I did it :)
I spent two hours more :) and I worked it out
so for me the post is no more actual
thanks and sorry for writing so many posts :)

U
Re: DND problem [message #171228 is a reply to message #170678] Tue, 16 December 2003 14:59 Go to previous message
Eclipse UserFriend
Originally posted by: John_Arthorne.oti.com_

Local selection transfer is only for use within a single viewer. See
also the following article:

http://www.eclipse.org/articles/Article-Workbench-DND/drag_d rop.html
--

Artek wrote:
> I spent 4 hours and finally I given up :(
> here is the problem:
>
> I have TableViewer and TreeViewer, and I defined DND operations as follows:
> ---------
> private class DragAdapter extends DragSourceAdapter {
> public void dragSetData(DragSourceEvent event) {
> event.data = tableViewer.getSelection();
> System.out.println("dragData: " + event.data);
> }
>
> Transfer[] transfers = new Transfer[] {
> LocalSelectionTransfer.getInstance() };
> tableViewer.addDragSupport(DND.DROP_MOVE, transfers, new DragAdapter());
> ---------
> private class DropAdapter extends DropTargetAdapter {
> public void drop(DropTargetEvent event){
> System.out.println("dropData: " + event.data);
> }
> }
> Transfer[] transfers = new Transfer[] {
> LocalSelectionTransfer.getInstance() };
> treeViewer.addDropSupport(DND.DROP_MOVE, transfers, new DropAdapter());
> ---------
>
> after performing DND operation the result is:
> dragData: [xxx, yyy, etc...]
> dropData: null
>
> why the data in event object is null ?
> what did I miss ?
> please help
>
> thanks in advance
>
> Artur
>
>
Previous Topic:I've got only 1 big project...Eclipse 3M5 takes forever to rebuild the workspace
Next Topic:page.bringToTop(IEditorPart)
Goto Forum:
  


Current Time: Fri May 02 14:09:05 EDT 2025

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

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

Back to the top