Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag and Drop walkthrough
Drag and Drop walkthrough [message #202565] Thu, 10 November 2005 22:42 Go to next message
rob bercik is currently offline rob bercikFriend
Messages: 15
Registered: July 2009
Junior Member
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
Re: Drag and Drop walkthrough [message #202573 is a reply to message #202565] Fri, 11 November 2005 00:33 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Drag and Drop walkthrough [message #205150 is a reply to message #202609] Tue, 13 December 2005 00:20 Go to previous message
rob bercik is currently offline rob bercikFriend
Messages: 15
Registered: July 2009
Junior Member
Harsh wrote:
> 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
>

Where is the factory object that I need to register with?

Thanks,
Rob
Previous Topic:shapes or logic examples
Next Topic:Plugin files ...
Goto Forum:
  


Current Time: Thu Apr 25 14:46:02 GMT 2024

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

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

Back to the top