Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Copy and Paste - Geronimo!!
Copy and Paste - Geronimo!! [message #538094] Fri, 04 June 2010 22:23 Go to next message
Steven Punte is currently offline Steven PunteFriend
Messages: 34
Registered: July 2009
Member
For those of you who are unfamiliar, Geronimo was one of the last great Native America Leaders / Warriors of the 19th century. For some reason Americans commonly call out his name when they jump out of an airplane or face some other great danger, but I digress...

Why is GMF Copy and Paste so difficult?

I've looked over a variety of notes, bugs, and some on-line articles. A basic copy and paste is operational on 3.4 when ONLY using GMF in a single file mode (i.e. model and diagram are both in same file). However, it also seems to work for me with WITHOUT resorting to enabling UUIDs.

I am about to create custom handlers, etc... to achieve copy and paste operation base on the information I have assimilated.

However, I would greatly appreciate if a core member could answer a few questions:

* Why are UUIDs needed? I understand what they are especially in an EMF context, but why is this discussed so much for this issue?
* Why does a simple example NOT seem to need them (i.e., UUIDs)?
* Why does copy-and-paste work ONLY on the single-file case and not the multi-file case situation? Will it be prohibitively difficult for me to get it to operate for the multi-file case situation?
* What broke and why from Eclipse release 3.4 to 3.5 or GMF Release 2.2.0 to 2.2.2?
* Are the support of compartments going to be challenging too?
* If I achieve a reasonable implementation, can I contribute it back to release 3.6 sr2?
* Will Graphiti replace GMF?

Thanks in Advance,

Geronimo
Re: Copy and Paste - Geronimo!! [message #538338 is a reply to message #538094] Mon, 07 June 2010 12:07 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi Geronimo,

Comments below.

Steven Punte a écrit :
> For those of you who are unfamiliar, Geronimo was one of the last great
> Native America Leaders / Warriors of the 19th century. For some reason
> Americans commonly call out his name when they jump out of an airplane
> or face some other great danger, but I digress...
>
> Why is GMF Copy and Paste so difficult?

May be because copy-paste is an easy to use functionality but is difficult to implement
in a generic AND extensible way for graphical modelers.

>
> I've looked over a variety of notes, bugs, and some on-line articles. A
> basic copy and paste is operational on 3.4 when ONLY using GMF in a
> single file mode (i.e. model and diagram are both in same file).
> However, it also seems to work for me with WITHOUT resorting to enabling
> UUIDs.
> I am about to create custom handlers, etc... to achieve copy and paste
> operation base on the information I have assimilated.

First there is two ways for implementing copy-paste in your GMF based application :

- org.eclipse.gmf.runtime.emf.clipboard.core.clipboardSupport

To customize the current copy-paste default behavior. You have to use UUID in you domain model resource factory.

- org.eclipse.gmf.runtime.common.ui.services.action.globalActi onHandlerProviders

To override completely copy-paste default behavior.

>
> However, I would greatly appreciate if a core member could answer a few
> questions:
>
> * Why are UUIDs needed? I understand what they are especially in an
> EMF context, but why is this discussed so much for this issue?

On a functional view UUIDs are used to identify eObject instances without referencing them by a feature (for instance their name) or an index. UUIDs
have one quality, they will not change between copy and paste operation, while index or name could.
On a technical view, the clipboard content is saved in a String. So GMF used a special resource and write its content to a String. This resource use UUID.

> * Why does a simple example NOT seem to need them (i.e., UUIDs)?
> * Why does copy-and-paste work ONLY on the single-file case and not
> the multi-file case situation? Will it be prohibitively difficult for
> me to get it to operate for the multi-file case situation?

If you are single file (i.e. model and diagram are both in same file) the resource used is a GMFResource one which use UUID.
So if you are multi-file case, you simply need in theory to use UUIDs in your domain model resource.

> * What broke and why from Eclipse release 3.4 to 3.5 or GMF Release
> 2.2.0 to 2.2.2?

I could not answer. If you think there is a regression, open a bug with a reproducible test case.
Of course correction it will be faster, if you provide a patch and associated test.

> * Are the support of compartments going to be challenging too?
http://wiki.eclipse.org/GMF_Newsgroup_Q_and_A#How_to_make_co py.2Fpaste_work_on_compartments.3F

> * If I achieve a reasonable implementation, can I contribute it back
> to release 3.6 sr2?

All bugfixes are welcome.

> * Will Graphiti replace GMF?

GMF runtime is a runtime for modelers over GEF and Graphiti is another. They do not have the same API and not the same committers, you are free
to use the one you prefer :).

>
> Thanks in Advance,
>
> Geronimo
>

Regards,

Mariot
Re: Copy and Paste - Geronimo!! [message #541183 is a reply to message #538338] Fri, 18 June 2010 14:59 Go to previous messageGo to next message
Robert Lewis is currently offline Robert LewisFriend
Messages: 24
Registered: July 2009
Junior Member
I am running into a copy and paste problem from eclipse gmf 3.5.1 to 3.5.1 (gmf 2.1 to gmf 2.2).

This is a serious problem for us and i am not sure how to fix it. Basically, copy and paste stopped working.

I am not sure what broke or how to fix it, so any ideas are appreicated. IF any information is needed let me know!
Re: Copy and Paste - Geronimo!! [message #541195 is a reply to message #541183] Fri, 18 June 2010 15:30 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Robert Lewis a écrit :
> I am running into a copy and paste problem from eclipse gmf 3.5.1 to
> 3.5.1 (gmf 2.1 to gmf 2.2).
>
> This is a serious problem for us and i am not sure how to fix it.
> Basically, copy and paste stopped working.
>
> I am not sure what broke or how to fix it, so any ideas are appreicated.
> IF any information is needed let me know!


Do you contribute a clipboard support factory with lowest priority ?
In this case have a look to https://bugs.eclipse.org/bugs/show_bug.cgi?id=317035
Workaround for that bug is to increment contribution priority.

Otherwise please provide more information.
Re: Copy and Paste - Geronimo!! [message #541196 is a reply to message #541195] Fri, 18 June 2010 15:51 Go to previous messageGo to next message
Robert Lewis is currently offline Robert LewisFriend
Messages: 24
Registered: July 2009
Junior Member
Mariot,

Thanks for the quick reply! I probably do not do this. I am new to GMF and fixing some code someone left behind. If you have any details on how to change the priority, that would really help.

Thanks,
-Rob

Edit: Nevermind, it is detailed in the bug, sorry! I will try the workaround in a moment.

[Updated on: Fri, 18 June 2010 15:55]

Report message to a moderator

Re: Copy and Paste - Geronimo!! [message #541199 is a reply to message #541196] Fri, 18 June 2010 16:06 Go to previous message
Robert Lewis is currently offline Robert LewisFriend
Messages: 24
Registered: July 2009
Junior Member
Mariot,

This indeed fixes the problem. Thank you so much!

-Rob
Previous Topic:Live validation
Next Topic:Which method is called when the cursor passes over a figure?
Goto Forum:
  


Current Time: Sun Oct 06 12:29:22 GMT 2024

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

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

Back to the top