Community
Participate
Working Groups
Build Identifier: Currently, the default copy behavior is to store the copied objects URIs in the clipboard, and the obvious paste implementation is to use AbstractPasteFeature.getCopiesFromClipBoard(diagram) to retrieve them. This way, ModelClipboard resolves the URIs in the target diagram's resourceSet. Even if the copied objects are modified, the ResourceSet resolves the URI to the live, in-memory version of the eobject. However, if we try to paste the eobject in a different diagram, that diagram's resourceset resolves the URI with the stale, in-disk version of the eobject, which may even not exist. If we were using the LocalSelectionTransfer as per bug #374744, it could be used in ModelClipboard.getContentAsEObjects to retrieve the live eobjects. The current logic in the inner class CopyCommand should succeed in copying the objects in the target editing domain. For more info, see http://www.eclipse.org/forums/index.php/t/313337/ Reproducible: Always
Created attachment 213051 [details] Proposed patch Use LocalSelectionTransfer both for copying and pasting. Solves both this bug and bug #374744.
Created attachment 213052 [details] New test case New test case, copying between two unsaved diagrams, that failed before this bug, yet works after applying the previous patch.
Thanks for the contributions! I have taken included them into our codebase (with minor changes) and submitted the stuff to Eclipse.
Besides I stumbled over another bug while testing this: the DefaultCopyFeature always made the editor dirty although nothing was changed; to fix this I have overridden the method hasDoneChanges and returned fase in that feature.
Bookkeeping: Set target release
Part of Graphiti 0.9.0 (Eclipse Juno)