Copy and Paste - Geronimo!! [message #538094] |
Fri, 04 June 2010 22:23 |
Steven Punte 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 |
Mariot Chauvin 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 #541196 is a reply to message #541195] |
Fri, 18 June 2010 15:51 |
Robert Lewis 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds