Drag-drop from Project Explorer to Diagram [message #199979] |
Mon, 04 August 2008 01:15  |
Eclipse User |
|
|
|
Hi,
I am trying to implement drag and drop from model nodes in the Project
Explorer tree (generated with GMF's navigator generator) into an open
GMF model diagram. For example:
project
- foo.model
- Component A
- Component B
- Child C
- another.model
If I have foo.model_diagram or another.model_diagram currently open, I'd
like to be able to drag and drop any of the Components or Children onto
the window.
So far I have worked out that I need to add a DragSourceListener onto
the Project Explorer window (somehow), and a resulting
DropTargetListener onto the ViewPart, using a custom Transfer class
based likely on SimpleObjectTransfer. Is this right?
How can I reference the Project Explorer window to register an
additional DragSourceListener? Or am I going the wrong way about this
(mixing GMF/GEF with SWT/Eclipse)?
Is there an example I could build upon? The Logic example allows for
drag-dropping items within the Outline view, but doesn't link up with
the Navigator or allow drag-drop from outline view to current view window.
Currently I can handle IResource drag-drops (ResourceTransfer) (I
think), but these aren't helpful because the data is set to null when
dragging one of the model components, so I can't see what was actually
dragged.
Thanks for any help.
Jevon
|
|
|
|
|
|
|
Re: Drag-drop from Project Explorer to Diagram [message #207635 is a reply to message #207627] |
Wed, 01 October 2008 09:50  |
Eclipse User |
|
|
|
Originally posted by: manojm.blr.interrasystems.com
Thanks Alex,
But how should I make my editor aware of the fact, that the dropped
element is from other model?
Please provide me some clue.
Regards,
Manoj
Alex Shatalin wrote:
> Hello Manoj,
>
>> I want to implement DnD, from different medel to GMF editor.
>
> You can use GMF-generated as an example of D&D implementation and try
> doing the same in with different model view/editor..
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03750 seconds