Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Copy & Paste, CopyPaste, Duplication
Copy & Paste, CopyPaste, Duplication [message #232294] Thu, 04 June 2009 08:08 Go to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
I know there are lots of threads and bugzillas addressing this issue (and
I guess I've read most of them), but I did not get it to work.

https://bugs.eclipse.org/263226
[CopyPaste] Copy action does not work anymore

https://bugs.eclipse.org/176007
Edit/(Duplication | Copy&PasteDuplication) corrupts notation model

I tried it with Taipan application (split model/diagram files):
- Create new Ship
- Copy/Paste Ship
- Delete new Ship from Model

The model is broken, and when I save it and try to load again, it will
even welcome me with a nice exception:
java.lang.ClassCastException:
org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be cast to
java.lang.String

As far as I can see, UUIDs should be enabled in
...taipan.gmf.editor.rcp/plugin.xml, but that does not seem to have an
effect:
<extension point="org.eclipse.emf.ecore.extension_parser">
<?gmfgen generated="true"?>
<parser
type="taipan_diagram"

class=" org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactor y ">
</parser>
</extension>

Another strange thing is, that it works as expected when I drag/drop the
node pressing Ctrl. A deep copy of the node is created.
XxxClipboardSupport does not seem to get used for this, except for
notifying (sendCreateNotification).

Can I maybe make use of this behavior?

Has anyone managed to get Copy&Paste working with split model/diagram
files?

Will a custom ClipboardSupport help me at all?

Any help highly appreciated, thanks in advance!
Re: Copy & Paste, CopyPaste, Duplication [message #232396 is a reply to message #232294] Thu, 04 June 2009 14:38 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

> As far as I can see, UUIDs should be enabled in
> ..taipan.gmf.editor.rcp/plugin.xml, but that does not seem to have an
> effect:
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <?gmfgen generated="true"?>
> <parser
> type="taipan_diagram"
> class=" org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactor y ">
> </parser>
> </extension>
This means UUID support is switched on for *.taipan_diagram resoruces (diagram
files). To make cut/copy/paste functionality working you have to switch on
this support for *.taipan resources too.

> Another strange thing is, that it works as expected when I drag/drop
> the node pressing Ctrl. A deep copy of the node is created.
Is it something like "edit/duplicate" action from the popup menu?

-----------------
Alex Shatalin
Re: Copy & Paste, CopyPaste, Duplication [message #232609 is a reply to message #232396] Fri, 05 June 2009 11:21 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Thanks Alex, see below...

>> As far as I can see, UUIDs should be enabled in
>> ..taipan.gmf.editor.rcp/plugin.xml, but that does not seem to have an
>> effect:
>> <extension point="org.eclipse.emf.ecore.extension_parser">
>> <?gmfgen generated="true"?>
>> <parser
>> type="taipan_diagram"
>> class=" org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactor y ">
>> </parser>
>> </extension>
> This means UUID support is switched on for *.taipan_diagram resoruces
> (diagram files). To make cut/copy/paste functionality working you have
> to switch on this support for *.taipan resources too.
You're right, of course!
Enabling UUID support for *.taipan did not solve the problem though (I
checked model file, UUIDs are used now). Same problem as before.

With RCP version (org.eclipse.gmf.examples.taipan.gmf.editor.rcp) it
even raises an exception now when I try to copy a node.
Not sure how to debug this, I paused the application in the error dialog
which provides no stacktrace and looked into the exception, so the
following stacktrace is handwritten :)

java.lang.NullPointerException
at
org.eclipse.gmf.runtime.common.ui.util.StatusLineUtil.getSta tusLineManager(StatusLineUtil.java:90)
at
org.eclipse.gmf.runtime.common.ui.util.StatusLineUtil.output ErrorMessage(StatusLineUtil.java:48)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:357)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
at org.eclipse.swt.custom.BusyIndicator(BusyIndicator.java:70)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager(Actio nManager.java:223)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er(AbstractActionHandler.java
[...]

Can you reproduce this?
Simple add UUID-support to the TaiPan RCP example and run, then copy a node.

>> Another strange thing is, that it works as expected when I drag/drop
>> the node pressing Ctrl. A deep copy of the node is created.
> Is it something like "edit/duplicate" action from the popup menu?
Yes, duplication seems to be the same Ctrl+DnD. I was not even aware of
that function. This could be sufficient for some requirements, but not
for all...

Am I doing something wrong, or does Copy&Paste simply not work with
split model/diagram files?

If so, is there anything I can do?

Regards, Peter
Re: Copy & Paste, CopyPaste, Duplication [message #232645 is a reply to message #232609] Fri, 05 June 2009 11:28 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

> Am I doing something wrong, or does Copy&Paste simply not work with
> split model/diagram files?
We do not generate D&D support, so it came from runtime libraries. We have
a request to cover D&D by generation, but it is not done yet. We use generic
runtime D&D support and it was claimed it is working with UUID switched on.
So, you can either implement D&D by your own or wait till it will be covered
by generation process.

-----------------
Alex Shatalin
Re: Copy & Paste, CopyPaste, Duplication [message #232676 is a reply to message #232645] Fri, 05 June 2009 11:38 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
>> Am I doing something wrong, or does Copy&Paste simply not work with
>> split model/diagram files?
> We do not generate D&D support, so it came from runtime libraries. We
> have a request to cover D&D by generation, but it is not done yet. We
> use generic runtime D&D support and it was claimed it is working with
> UUID switched on. So, you can either implement D&D by your own or wait
> till it will be covered by generation process.
Hi Alex,

I do not need DnD support, I just mentioned that it works almost as I
would expect copy&paste to work (same as Duplicate).

What I would have expected was standard copy&paste support which does
not seem to work.

So the initial questions remain:
Has anyone managed to get Copy&Paste working with split model/diagram files?

Will a custom ClipboardSupport help me at all?

Regards, Peter
Re: Copy & Paste, CopyPaste, Duplication [message #232715 is a reply to message #232676] Fri, 05 June 2009 13:08 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

> I do not need DnD support, I just mentioned that it works almost as I
> would expect copy&paste to work (same as Duplicate).
Sorry, all I wrote was about Cut/Copy/Paste. :-)

-----------------
Alex Shatalin
Re: Copy & Paste, CopyPaste, Duplication [message #233062 is a reply to message #232715] Tue, 09 June 2009 11:09 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Thanks Alex, at least I know now, that it's not supposed to work :-)

Since bugzilla https://bugs.eclipse.org/263226 seems to describe exactly
the problem I encounter, any idea on when this issue will be addressed?

And any hint, where I would have to start with my own copy/paste
implementation?

Regards, Peter


> So, you can either implement D&D by your own or wait till it will be covered
> by generation process.
>> I do not need DnD support, I just mentioned that it works almost as I
>> would expect copy&paste to work (same as Duplicate).
> Sorry, all I wrote was about Cut/Copy/Paste. :-)
Re: Copy & Paste, CopyPaste, Duplication [message #233070 is a reply to message #233062] Tue, 09 June 2009 11:39 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

You can vote for this request. By voting for it you are showing it's important
for you.

> And any hint, where I would have to start with my own copy/paste
> implementation?
Well, AFAIR it's not so easy to modify/correct existing copy/paste implementation,
so i think you can try completely substituting existing implementation by
your own.
See DiagramUIRenderGlobalActionHandlerProvider (this class should be registered
into org.eclipse.gmf.runtime.common.ui.services.action.globalActi onHandlerProviders
extension point inside generated plugin.xml)

-----------------
Alex Shatalin
Re: Copy & Paste, CopyPaste, Duplication [message #233222 is a reply to message #233062] Wed, 10 June 2009 09:07 Go to previous messageGo to next message
Javier is currently offline JavierFriend
Messages: 57
Registered: July 2009
Member
This post :
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg16777.html
will lead you to an EclipseBased application, Moskitt. As it says, it
implements its own copy&paste, and that might be a good point to begin.
I found that really useful.

Peter Lang escribió:
> Thanks Alex, at least I know now, that it's not supposed to work :-)
>
> Since bugzilla https://bugs.eclipse.org/263226 seems to describe exactly
> the problem I encounter, any idea on when this issue will be addressed?
>
> And any hint, where I would have to start with my own copy/paste
> implementation?
>
> Regards, Peter
>
>
>> So, you can either implement D&D by your own or wait till it will be
>> covered by generation process.
>>> I do not need DnD support, I just mentioned that it works almost as I
>>> would expect copy&paste to work (same as Duplicate).
>> Sorry, all I wrote was about Cut/Copy/Paste. :-)
>
>
Re: Copy & Paste, CopyPaste, Duplication [message #234399 is a reply to message #233222] Mon, 22 June 2009 08:09 Go to previous message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Thanks a lot, I will have a look at it, as soon as I have some time...


Javier wrote:

> This post :
> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg16777.html
> will lead you to an EclipseBased application, Moskitt. As it says, it
> implements its own copy&paste, and that might be a good point to begin.
> I found that really useful.

> Peter Lang escribió:
>> Thanks Alex, at least I know now, that it's not supposed to work :-)
>>
>> Since bugzilla https://bugs.eclipse.org/263226 seems to describe exactly
>> the problem I encounter, any idea on when this issue will be addressed?
>>
>> And any hint, where I would have to start with my own copy/paste
>> implementation?
>>
>> Regards, Peter
>>
>>
>>> So, you can either implement D&D by your own or wait till it will be
>>> covered by generation process.
>>>> I do not need DnD support, I just mentioned that it works almost as I
>>>> would expect copy&paste to work (same as Duplicate).
>>> Sorry, all I wrote was about Cut/Copy/Paste. :-)
>>
>>
Previous Topic:Add sub-nodes programmatically after creating node (GMF 2.2)
Next Topic:Problem opening ecore_diagram file/dynamic diagram generation
Goto Forum:
  


Current Time: Sun Apr 18 12:44:20 GMT 2021

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

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

Back to the top