|
Re: Drag and Drop walkthrough [message #202573 is a reply to message #202565] |
Fri, 11 November 2005 00:33 |
Eclipse User |
|
|
|
Originally posted by: info.dfm2html.com
>I have a few questions about drag and drop. Here's what I am trying to do.
>Basically I am trying to Drag one of my model objects that is displayed in
>a treeviewer into a graphical editor. Now here's my understanding of it
>with respect to what I am trying to do.
>
> 1.) Declare a transfer type which will handle serializing and
> de-serializing object to be transfered.
> 2.) In the treeviewer call the addDragSupport() method with appropriate
> Dragsourcelistener etc.
> -> do I also need to call addDropSupport() on treeviewer if I only want to
> allow dropping in the graphical viewer?
> 3.) I would assume i need to register something with the graphical viewer
> as well, but I am not sure exactly what.
First, on the GEF page there is a sample to accept Drops.
How to initiate Drags is described here:
http://www13.plala.or.jp/observe/GEF/GEF_Hello9.html
(its unfortunately japanese, but using babelfish i finally mangaged it in my
application to drag and drop from 2 different
GEF editors (each one in a seperate plugin. I tried only to drag&drop text
til now, but it worked).
The main idea for dragging is, that it is not down with the "selection tool"
but that some distinct tool (in japanese example
"FileTool" is chosen from the palette with which one can do the drag&drop.
Since this japanese drag method works over application boundaries, and you
seems to need only drag&drop within one plugin,
there may be an easier method where i cant help..
|
|
|
Re: Drag and Drop walkthrough [message #202609 is a reply to message #202573] |
Fri, 11 November 2005 14:32 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
You don't need to addDropSupport on the tree viewer if you are only
dropping in the editor. Also, GEF editors have built-in support for DND
so you just have to let it know the type in your factory.
Regards,
Harsh
|
|
|
Re: Drag and Drop walkthrough [message #202683 is a reply to message #202565] |
Fri, 11 November 2005 16:36 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
There is an entire article on DND
http://www.eclipse.org/gef/reference/articles.html
"Rob Bercik" <rob.bercik@gmail.com> wrote in message
news:dl0icv$gv9$1@news.eclipse.org...
>I have a few questions about drag and drop. Here's what I am trying to do.
>Basically I am trying to Drag one of my model objects that is displayed in
>a treeviewer into a graphical editor. Now here's my understanding of it
>with respect to what I am trying to do.
>
> 1.) Declare a transfer type which will handle serializing and
> de-serializing object to be transfered.
> 2.) In the treeviewer call the addDragSupport() method with appropriate
> Dragsourcelistener etc.
> -> do I also need to call addDropSupport() on treeviewer if I only want to
> allow dropping in the graphical viewer?
> 3.) I would assume i need to register something with the graphical viewer
> as well, but I am not sure exactly what.
>
> Any help would be appreciated.
>
> Thanks,
> ROb
|
|
|
|
Powered by
FUDForum. Page generated in 0.03001 seconds