Community
Participate
Working Groups
Build Identifier: LocalSelectionTransfer is different from the other available transfers. Instead of using the data set in the Clipboard.setContents method, if uses the selection set by calling LocalSelectionTransfer.setSelection. This is because it's supposed to work only within the same running eclipse instance, so the data doesn't make it the OS's clipboard. Currently, ModelClipboard.setNativeContentObjects "activates" the LocalSelectionTransfer, by calling setContents with it, but doesn't call setSelection, so either it's empty, or, even worse, it contains info from a previous, unrelated copy. Solution proposed: Change the toTransferObjects method of ModelClipboard, from: > result.put(LocalSelectionTransfer.getTransfer(), new StructuredSelection(objects)); to: > ISelection localSelection = new StructuredSelection(objects); > LocalSelectionTransfer.getTransfer().setSelection(localSelection); > result.put(LocalSelectionTransfer.getTransfer(), new Object()); Reproducible: Always
Indeed, this seems to be missing. But at least from a first look, I didn't get what effect this will have. Do you have an example where this causes an issue?
It prevents me from using the defaultCopyFeature, since I'm using the LocalSelection for the paste. Besides, since it activates the LocalSelection but leaves the content untouched, the workspace is left in a weird state. I can copy a text fragment, then copy from a diagram, and paste the original text fragment.
(In reply to comment #2) > It prevents me from using the defaultCopyFeature, since I'm using the > LocalSelection for the paste. > Besides, since it activates the LocalSelection but leaves the content > untouched, the workspace is left in a weird state. I can copy a text fragment, > then copy from a diagram, and paste the original text fragment. Ok, understood. Thanks!
Thanks for this contribution! I have changed the coding as you suggested. Checked-in and pusched to Eclipse: commit ca8407ecd4cf174ff80cb01cb97c5b15f34557b3 Author: mwenz <michael.wenz@sap.com> 2012-03-22 13:38:02 Committer: mwenz <michael.wenz@sap.com> 2012-03-22 13:38:02 Parent: c6e6d127c3f1ab1da0f5ca33c581ee6669bf7d2b (Updated News&Noteworthy for M6) Branches: origin/master, master
Bookkeeping: Set target release
Part of Graphiti 0.9.0 (Eclipse Juno)