Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Copy & Paste for GMF Editors (Mindmap-Example)
Copy & Paste for GMF Editors (Mindmap-Example) [message #506666] Fri, 08 January 2010 15:38 Go to next message
Johannes Michler is currently offline Johannes MichlerFriend
Messages: 21
Registered: July 2009
Junior Member
Hi,

I'm implementing an RCP+GMF-Modeling-Application. We're using GMF and
generated a graphical editor. For this editor we'd like to have
copy/paste support for modelling elements.

For better understanding, I'll describe what I want and what problems
arise based on the mindmap-rcp-example.

I first checked out org.eclipse.gmf.examples.mindmap.rcp.diagram (with
..edit plugin) from the cvs-examples. When starting the example, I
created a new mindmap diagram with a first topic. This results in a
..model-file with one topic and a diagram-file with one graphical
representation of this model.


When copying my topic and pasting it again in the same diagram, first
everything seems fine. But actually only the diagram-code gets
duplicated (now having two views for my topic). So only the
diagram-file gets changed. When I change the name of one topic in the
gmf-editor, the second gets changed accordingly. (Well of cause, this
are just 2 references to 1 model). Furthermore, when closing the
diagram and reopening it again, the second reference is gone, the
diagram is marked dirty and when saving, the second reference gets
deleted from the diagram-file.

What I'd like to have is, that copy- and pasting a topic results in the
creation of a new topic in model AND diagram. It would be best if I
could copy/paste a topic from one diagram to another one (in
copy-by-value not -by-reference-style). Is there a way to achieve this?


In addition: I think the current behaviour is a bug. Copying just the
graphical notation may be okay, but I think after closing and reopening
the editor the diagram should still be the same, shouldn't it?


any help would be highly appreciated,


Best regards
Johannes
(http://www.horus.biz)
--
Re: Copy & Paste for GMF Editors (Mindmap-Example) [message #506690 is a reply to message #506666] Fri, 08 January 2010 19:26 Go to previous messageGo to next message
Artur Kronenberg is currently offline Artur KronenbergFriend
Messages: 159
Registered: August 2009
Senior Member
Johannes,

this is the generated behaviour of GMF. To have the actual copy/paste you want to, you need to enable the UUIDs with the extensionParser extension point. You can read about it here:

http://serdom.eu/ser/2007/03/05/how-to-enable-uuid-in-emf-ge nerated-model-to-get-copypaste-working

Best regards,
Artur
Re: Copy & Paste for GMF Editors (Mindmap-Example) [message #506890 is a reply to message #506690] Mon, 11 January 2010 08:53 Go to previous messageGo to next message
Johannes Michler is currently offline Johannes MichlerFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Artur,


thanks for your reply. I'm afraid that in my opinion this isn't the
problem for me. Our own Application uses GMFResourceFactory and
therefore GMFResource which should have enabled UUIDs.

I now tried set the GMFResourceFactory for .mindmap in the
mindmap-example too. This unfortunately gives me the exactly same
behavior than before (well now in the diagram-file the model-elements
are referenced by their IDs instead of the xpath-expressions with
numbered access, but the copy/paste-behavior is still the same :-( )



Any other suggestions?

-Johannes


Artur Kronenberg wrote:

> Johannes,
>
> this is the generated behaviour of GMF. To have the actual copy/paste
> you want to, you need to enable the UUIDs with the extensionParser
> extension point. You can read about it here:
>
> http://serdom.eu/ser/2007/03/05/how-to-enable-uuid-in-emf-ge nerated-mo
> del-to-get-copypaste-working
>
> Best regards,
> Artur



--
Re: Copy & Paste for GMF Editors (Mindmap-Example) [message #508149 is a reply to message #506890] Sat, 16 January 2010 16:27 Go to previous message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
Johannes Michler wrote on Mon, 11 January 2010 03:53
Hi Artur,
behavior than before (well now in the diagram-file the model-elements
are referenced by their IDs instead of the xpath-expressions with
numbered access, but the copy/paste-behavior is still the same Sad )



This bug is known for years and many people have complained about it on the forum. Some of them have solved it in their own projects, but nobody submitted a solution to the bugzilla. Try to search this forum and you will find many topics about Copy&Paste. Some of them can be useful.

Best regards,
Seweryn
Previous Topic:connection and node
Next Topic:gmf
Goto Forum:
  


Current Time: Fri Apr 16 18:36:38 GMT 2021

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

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

Back to the top