|
|
|
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 06:43   |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.58217 seconds