Skip to main content



      Home
Home » Modeling » EMF » Drag'n drop (or cut & paste) programmatically
Drag'n drop (or cut & paste) programmatically [message #1071003] Fri, 19 July 2013 02:06 Go to next message
Eclipse UserFriend
Hello,

I would like to know how to make a drag'n drop (or cut & paste) from a plugin code.

I saw that there are some classes to do that in emf (like org.eclipse.emf.edit.ui.action.PasteAction) but I want to know how to use it.

My goal is to automatically move an object in a package (same Model). But I need to keep the dependencies, profiles applications ...

Thanks,

Adrien
Re: Drag'n drop (or cut & paste) programmatically [message #1071019 is a reply to message #1071003] Fri, 19 July 2013 03:07 Go to previous messageGo to next message
Eclipse UserFriend
Adrien,

You can of course look at the implementations of these things and use
the debugger to see how they behave in an editor. It sounds like you're
working with UML2 so I'd be surprised if you could do this just using
UML2's APIs.


On 19/07/2013 8:06 AM, Adrien Mallo wrote:
> Hello,
>
> I would like to know how to make a drag'n drop (or cut & paste) from a
> plugin code.
>
> I saw that there are some classes to do that in emf (like
> org.eclipse.emf.edit.ui.action.PasteAction) but I want to know how to
> use it.
>
> My goal is to automatically move an object in a package (same Model).
> But I need to keep the dependencies, profiles applications ...
>
> Thanks,
>
> Adrien
Re: Drag'n drop (or cut & paste) programmatically [message #1071058 is a reply to message #1071019] Fri, 19 July 2013 04:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi

org.eclipse.swt.dnd is where the code is. Google for examples.

The UML Model Editor (and Papyrus editors) already have some drag and
drop support.

Regards

Ed Willink


On 19/07/2013 08:07, Ed Merks wrote:
> Adrien,
>
> You can of course look at the implementations of these things and use
> the debugger to see how they behave in an editor. It sounds like
> you're working with UML2 so I'd be surprised if you could do this just
> using UML2's APIs.
>
>
> On 19/07/2013 8:06 AM, Adrien Mallo wrote:
>> Hello,
>>
>> I would like to know how to make a drag'n drop (or cut & paste) from
>> a plugin code.
>>
>> I saw that there are some classes to do that in emf (like
>> org.eclipse.emf.edit.ui.action.PasteAction) but I want to know how to
>> use it.
>>
>> My goal is to automatically move an object in a package (same Model).
>> But I need to keep the dependencies, profiles applications ...
>>
>> Thanks,
>>
>> Adrien
>
Re: Drag'n drop (or cut & paste) programmatically [message #1071081 is a reply to message #1071019] Fri, 19 July 2013 05:56 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Thanks for your answers.

Ed Merks wrote on Fri, 19 July 2013 03:07
Adrien,

You can of course look at the implementations of these things and use
the debugger to see how they behave in an editor. It sounds like you're
working with UML2 so I'd be surprised if you could do this just using
UML2's APIs.


I guess that you meant that I can use UML2's APIs only to make take. I'm currently trying to use these APIs but I'm losing every profileApplication when I move a Classifier.

Ed Willink wrote on Fri, 19 July 2013 04:57

Hi

org.eclipse.swt.dnd is where the code is. Google for examples.

The UML Model Editor (and Papyrus editors) already have some drag and
drop support.

Regards

Ed Willink


Thx I'm gonna look this code !

Adrien
Re: Drag'n drop (or cut & paste) programmatically [message #1071098 is a reply to message #1071081] Fri, 19 July 2013 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Adrian,

You're probably best to look at how the copy and paste commands are
specialized for UML2. You might ask on the UML2 newsgroup how you can
move something and at the same time ensure that the profile application
follows along...


On 19/07/2013 11:56 AM, Adrien Mallo wrote:
> Hello,
>
> Thanks for your answers.
>
> Ed Merks wrote on Fri, 19 July 2013 03:07
>> Adrien,
>>
>> You can of course look at the implementations of these things and use
>> the debugger to see how they behave in an editor. It sounds like
>> you're working with UML2 so I'd be surprised if you could do this
>> just using UML2's APIs.
>
>
> I guess that you meant that I can use UML2's APIs only to make take.
> I'm currently trying to use these APIs but I'm losing every
> profileApplication when I move a Classifier.
>
> Ed Willink wrote on Fri, 19 July 2013 04:57
>> Hi
>>
>> org.eclipse.swt.dnd is where the code is. Google for examples.
>>
>> The UML Model Editor (and Papyrus editors) already have some drag and
>> drop support.
>>
>> Regards
>>
>> Ed Willink
>
>
> Thx I'm gonna look this code !
>
> Adrien
Re: Drag'n drop (or cut & paste) programmatically [message #1071107 is a reply to message #1071098] Fri, 19 July 2013 06:57 Go to previous message
Eclipse UserFriend
Ed Merks wrote on Fri, 19 July 2013 06:49
Adrian,

You're probably best to look at how the copy and paste commands are
specialized for UML2. You might ask on the UML2 newsgroup how you can
move something and at the same time ensure that the profile application
follows along...


Yes I have come to the same conclusion, I can probably use the UML2 API to do what I want!

Thanks for your help.
Previous Topic:Xor Constraint with EMF
Next Topic:Upgrade of Xcore SDK produces strange errors
Goto Forum:
  


Current Time: Tue Jul 08 11:40:58 EDT 2025

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

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

Back to the top