Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361414

Summary: Copy/paste : clipboard contents confuses the workbench
Product: [Modeling] Graphiti Reporter: Hernan Gonzalez <hjg.com.ar>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: felix.velasco, matthias.gorning, michael.wenz
Version: 0.8.0Flags: michael.wenz: juno+
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375334
Whiteboard: Juno M7 Theme_bugs
Attachments:
Description Flags
Proposed patch michael.wenz: iplog+

Description Hernan Gonzalez CLA 2011-10-19 10:51:50 EDT
Build Identifier: 

I believe this is caused by the way in which Graphiti implements copy/paste, using the Eclipse (SWT) clipboard, and because the copied objects in the clipboad adapt to IFile (or IResource).

Perhaps this should be considered in some more global copy/paste functionality redesign, if deemed appropiate.

Related discussion in the forum: http://www.eclipse.org/forums/index.php/mv/msg/246748/737250/

Reproducible: Always

Steps to Reproduce:
1. In the tutorial, create som some graphical object/s in the Graphical editor and copy it/them.
2. Go to the Navigator (or Project Explorer), with the project or any other element selected, right-click for the context-menu
3. The Paste command is enabled, and when executed it tries to copy the file.
Comment 1 Felix Velasco CLA 2012-03-21 12:34:41 EDT
Created attachment 213016 [details]
Proposed patch

Only uses FileTransfer and ResourcesTransfer if any of the selected elements can adapt to IFile, or is the only element contained in that IFile.
Comment 2 Michael Wenz CLA 2012-03-26 10:18:31 EDT
Thanks for the contribution! I have checked-in the patch and pushed it to Eclipse:
commit a36b594ba6316e4aeb608b3c8a2df98c70b553f9
Author: mwenz <michael.wenz@sap.com> 2012-03-26 15:31:02
Committer: mwenz <michael.wenz@sap.com> 2012-03-26 15:31:02
Parent: b86ed73db2028058344bdd3b18a8057d7fa754df (Bug 374918 - Let default paste use LocalSelectionTransfer)
Branches: origin/master, master
Comment 3 Michael Wenz CLA 2012-03-26 10:22:23 EDT
After having a closer look, I think the clipboard and the copy/paste functionality deserve a clean-up (probably after the Juno release). I have opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=375334 for that.
Comment 4 Michael Wenz CLA 2012-04-11 10:57:54 EDT
Bookkeeping: Set target release
Comment 5 Michael Wenz CLA 2012-06-29 04:23:17 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)