Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it (Getting even (French version: "Pour en finir une bonne fois pour toute avec le probleme de gmf copy-paste"))
icon10.gif  Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it [message #665205] Wed, 13 April 2011 16:25 Go to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Hello,

I have seen a lot of posts on this forum related to the copy-paste problem, and no post with a complete solution, just clues.
First of all, to be clear: copy-paste is not implemented in GMF (although it might look as if it was) but everything is there for one to implement it.
I postponed the implementation of the copy-paste functionality of my editor for a long time as I thought it was very difficult to do. When I started this work, I had the first version (very simple, with only one type of object) working the very first day.
I used a document I found on http://www.moskitt.org and I also took a look at the copy-paste implementation in the bonita software (www.bonitasoft.com).
I am working myself for the WorkflowStudio provided by the open source project http://proactive.inria.fr

I wrote a post on my newly created WordPress blog containing a complete solution for the copy-paste functionality within a GMF-based editor.

to whom it may concern:

http://esalagea.wordpress.com/2011/04/13/lets-solve-once-for -all-the-gmf-copy-paste-problem-and-then-forget-about-it/


cheers,
emil














[Updated on: Tue, 19 April 2011 11:02]

Report message to a moderator

Re: Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it [message #666128 is a reply to message #665205] Tue, 19 April 2011 08:48 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Hi emil,

I havn't tested your solution yet, but thanks for your post i had and i still have the same problem and its time to make an end to all that.

thanks again Wink
Re: Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it [message #666148 is a reply to message #666128] Tue, 19 April 2011 11:03 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
You'ŕe welcome,
I hope it helps Smile

emil.
Re: Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it [message #671271 is a reply to message #665205] Tue, 17 May 2011 10:43 Go to previous messageGo to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Emil,

thank you very much for your really useful solution to this problem, I tested it and it works very well. I've made some minor changes to your code, in MyEditorCopyCommand I stored the (copy of) selected objects directly in the system Clipboard instead of static variable, so MyEditorPasteCommand can retrieve them calling Clipboard.getContents(), obtaining a more decoupled design. Moreover, in MyEditorClipboardSupportGlobalActionHandler I needed to override the 'canPaste' method to enable the corresponding menu item and keyboard shortcut, because the superclass implementation doesn't fit to my needs.

Now, it remains just one problem: the 'cut' command fires after every selection change and compounds the copy command, sometimes returning null even when the copy operation was legal: do you have some tip to solve this problem?

Thank you very much, regards

Giovanni
Re: Let's solve once for all the Eclipse GMF copy-paste problem and then forget about it [message #674326 is a reply to message #665205] Thu, 26 May 2011 14:08 Go to previous message
Carlos  is currently offline Carlos Friend
Messages: 16
Registered: July 2009
Junior Member
Hi Emil,

Didn't tried this yet, but thank you very much for your efforts and for sharing it with the community.

Carlos
Previous Topic:Strange problem when creating a top node
Next Topic:clean editor thinks it's dirty
Goto Forum:
  


Current Time: Tue Apr 23 15:57:58 GMT 2024

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

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

Back to the top