Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » DnD in GMF Editor
DnD in GMF Editor [message #207529] Tue, 30 September 2008 13:52 Go to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi!

Could you suggest - how do I DnD an element from treeviewer (other than
ecore model) GMF editor?

Regards,
Manoj
Re: DnD in GMF Editor [message #207659 is a reply to message #207529] Wed, 01 October 2008 18:43 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Manoj

Get the GMF logic editor example. When you run the example, the wizard
allows you to store the semantics in a separate semantic resource. Now open
both the EMF editor for the semantic logic resource file and the GMF diagram
editor. You can create a LED in the EMF editor and drag it to the diagram
editor. So you now have an example dragging from a tree viewer to a GMF
editor.

If you look at the source code, there is a dnd handler that handles the drop
as an EObject, but you can create any dnd transfer adapter you want.

Cheers...
Anthony

"Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
news:gbtav4$7o2$1@build.eclipse.org...
> Hi!
>
> Could you suggest - how do I DnD an element from treeviewer (other than
> ecore model) GMF editor?
>
> Regards,
> Manoj
Re: DnD in GMF Editor [message #207758 is a reply to message #207659] Fri, 03 October 2008 06:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi! Anthony,

Could you please tell - where this dnd handler is implemented?

Regards,
Manoj

Anthony Hunter wrote:
> Hi Manoj
>
> Get the GMF logic editor example. When you run the example, the wizard
> allows you to store the semantics in a separate semantic resource. Now open
> both the EMF editor for the semantic logic resource file and the GMF diagram
> editor. You can create a LED in the EMF editor and drag it to the diagram
> editor. So you now have an example dragging from a tree viewer to a GMF
> editor.
>
> If you look at the source code, there is a dnd handler that handles the drop
> as an EObject, but you can create any dnd transfer adapter you want.
>
> Cheers...
> Anthony
>
> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
> news:gbtav4$7o2$1@build.eclipse.org...
>
>>Hi!
>>
>>Could you suggest - how do I DnD an element from treeviewer (other than
>>ecore model) GMF editor?
>>
>>Regards,
>>Manoj
>
>
>
Re: DnD in GMF Editor [message #207810 is a reply to message #207758] Fri, 03 October 2008 14:42 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Manoj

At a high level, Drag and Drop in Eclipse requires DragSourceListener and
DropTargetListener, both in SWT.

Bring up the class hiearchy for these two interfaces to find the GMF classes
that implement them.

Look in the packages and plug-ins where these classes exist.

Done, you have found the DND implementation in the GMF Runtime.

Let us know if this does not help.

Cheers...
Anthony

"Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
news:48E5BAD5.3030704@blr.interrasystems.com...
> Hi! Anthony,
>
> Could you please tell - where this dnd handler is implemented?
>
> Regards,
> Manoj
>
> Anthony Hunter wrote:
>> Hi Manoj
>>
>> Get the GMF logic editor example. When you run the example, the wizard
>> allows you to store the semantics in a separate semantic resource. Now
>> open both the EMF editor for the semantic logic resource file and the GMF
>> diagram editor. You can create a LED in the EMF editor and drag it to the
>> diagram editor. So you now have an example dragging from a tree viewer to
>> a GMF editor.
>>
>> If you look at the source code, there is a dnd handler that handles the
>> drop as an EObject, but you can create any dnd transfer adapter you want.
>>
>> Cheers...
>> Anthony
>>
>> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
>> news:gbtav4$7o2$1@build.eclipse.org...
>>
>>>Hi!
>>>
>>>Could you suggest - how do I DnD an element from treeviewer (other than
>>>ecore model) GMF editor?
>>>
>>>Regards,
>>>Manoj
>>
>>
Re: DnD in GMF Editor [message #208516 is a reply to message #207810] Tue, 14 October 2008 11:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi! Anthony,

I tried it by implementing TransferDropTargetListener.
While dragging the element from treeviewer, I can see it working(using
Systrace), but can not drop the element in editpart.

Could you please provide some link of code snippet?

Regards,
Manoj

Anthony Hunter wrote:
> Hi Manoj
>
> At a high level, Drag and Drop in Eclipse requires DragSourceListener and
> DropTargetListener, both in SWT.
>
> Bring up the class hiearchy for these two interfaces to find the GMF classes
> that implement them.
>
> Look in the packages and plug-ins where these classes exist.
>
> Done, you have found the DND implementation in the GMF Runtime.
>
> Let us know if this does not help.
>
> Cheers...
> Anthony
>
> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
> news:48E5BAD5.3030704@blr.interrasystems.com...
>
>>Hi! Anthony,
>>
>>Could you please tell - where this dnd handler is implemented?
>>
>>Regards,
>>Manoj
>>
>>Anthony Hunter wrote:
>>
>>>Hi Manoj
>>>
>>>Get the GMF logic editor example. When you run the example, the wizard
>>>allows you to store the semantics in a separate semantic resource. Now
>>>open both the EMF editor for the semantic logic resource file and the GMF
>>>diagram editor. You can create a LED in the EMF editor and drag it to the
>>>diagram editor. So you now have an example dragging from a tree viewer to
>>>a GMF editor.
>>>
>>>If you look at the source code, there is a dnd handler that handles the
>>>drop as an EObject, but you can create any dnd transfer adapter you want.
>>>
>>>Cheers...
>>>Anthony
>>>
>>>"Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
>>>news:gbtav4$7o2$1@build.eclipse.org...
>>>
>>>
>>>>Hi!
>>>>
>>>>Could you suggest - how do I DnD an element from treeviewer (other than
>>>>ecore model) GMF editor?
>>>>
>>>>Regards,
>>>>Manoj
>>>
>>>
>
Re: DnD in GMF Editor [message #208864 is a reply to message #208516] Thu, 16 October 2008 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi!

Have you found any example kind?
I have implemented AbstractDropTargetListener to my editor. Using whicth
I can see the handleDrop() responding.
Also I Habe implemented DragDropEditPolicy on editpart,
but while dropping on editpart it not listening.
On drop, I want to create a chile element on it.

Regards,
Manoj

Manoj Mitra wrote:
> Hi! Anthony,
>
> I tried it by implementing TransferDropTargetListener.
> While dragging the element from treeviewer, I can see it working(using
> Systrace), but can not drop the element in editpart.
>
> Could you please provide some link of code snippet?
>
> Regards,
> Manoj
>
> Anthony Hunter wrote:
>
>> Hi Manoj
>>
>> At a high level, Drag and Drop in Eclipse requires DragSourceListener
>> and DropTargetListener, both in SWT.
>>
>> Bring up the class hiearchy for these two interfaces to find the GMF
>> classes that implement them.
>>
>> Look in the packages and plug-ins where these classes exist.
>>
>> Done, you have found the DND implementation in the GMF Runtime.
>>
>> Let us know if this does not help.
>>
>> Cheers...
>> Anthony
>>
>> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
>> news:48E5BAD5.3030704@blr.interrasystems.com...
>>
>>> Hi! Anthony,
>>>
>>> Could you please tell - where this dnd handler is implemented?
>>>
>>> Regards,
>>> Manoj
>>>
>>> Anthony Hunter wrote:
>>>
>>>> Hi Manoj
>>>>
>>>> Get the GMF logic editor example. When you run the example, the
>>>> wizard allows you to store the semantics in a separate semantic
>>>> resource. Now open both the EMF editor for the semantic logic
>>>> resource file and the GMF diagram editor. You can create a LED in
>>>> the EMF editor and drag it to the diagram editor. So you now have an
>>>> example dragging from a tree viewer to a GMF editor.
>>>>
>>>> If you look at the source code, there is a dnd handler that handles
>>>> the drop as an EObject, but you can create any dnd transfer adapter
>>>> you want.
>>>>
>>>> Cheers...
>>>> Anthony
>>>>
>>>> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
>>>> news:gbtav4$7o2$1@build.eclipse.org...
>>>>
>>>>
>>>>> Hi!
>>>>>
>>>>> Could you suggest - how do I DnD an element from treeviewer (other
>>>>> than ecore model) GMF editor?
>>>>>
>>>>> Regards,
>>>>> Manoj
>>>>
>>>>
>>>>
>>
Re: DnD in GMF Editor [message #209124 is a reply to message #207659] Wed, 22 October 2008 00:33 Go to previous message
zhaozhongwei is currently offline zhaozhongweiFriend
Messages: 9
Registered: July 2009
Junior Member
Anthony Hunter wrote:

> Hi Manoj

> Get the GMF logic editor example. When you run the example, the wizard
> allows you to store the semantics in a separate semantic resource. Now open
> both the EMF editor for the semantic logic resource file and the GMF diagram
> editor. You can create a LED in the EMF editor and drag it to the diagram
> editor. So you now have an example dragging from a tree viewer to a GMF
> editor.

> If you look at the source code, there is a dnd handler that handles the drop
> as an EObject, but you can create any dnd transfer adapter you want.

> Cheers...
> Anthony

> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
> news:gbtav4$7o2$1@build.eclipse.org...
>> Hi!
>>
>> Could you suggest - how do I DnD an element from treeviewer (other than
>> ecore model) GMF editor?
>>
>> Regards,
>> Manoj
i have tried it ,just ad i tried with the taipan example,when the original
model is deleted,the droped model does not exist too!that is the
problem!maybe it is easy to make it when the model to be dropped is a
simple one,but when it is very complex,how to make a full deep copy of
it(them)?
thanks for you answer in advance
Previous Topic:Additional view initialization
Next Topic:DropObjectsRequest problem
Goto Forum:
  


Current Time: Thu May 13 23:10:02 GMT 2021

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

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

Back to the top