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

Bug 319662

Summary: [CopyPaste] Papyrus shall enable Copy/Paste between view editors and model explorer.
Product: [Modeling] Papyrus Reporter: Ansgar Radermacher <ansgar.radermacher>
Component: CoreAssignee: Remi Schnekenburger <rschnekenburger>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: benoit.maggi, faure.tristan, papyrus-bugs, ronan.barrett, rschnekenburger
Version: 1.0.0Flags: rschnekenburger: luna+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: dx copy
Bug Depends on:    
Bug Blocks: 290261    

Description Ansgar Radermacher CLA 2010-07-13 03:33:11 EDT
Build Identifier: 

Copy/Paste currently does not support an exchange between diagrams and model explorer. It is not possible to:

1. Copy in model explorer, paste in diagram [=> should be a visual copy, as in dragging of model explorer elements]
2. Copy in model explorer, paste with model in diagram [=> should be a model + visual copy]
3. Copy in diagram, paste in model explorer [=> should be a model copy]
4. Copy/paste between different models


Reproducible: Always
Comment 1 Yann Tanguy CLA 2012-02-28 12:08:00 EST
"Copy in model explorer, paste in diagram" currently generates an exception:

java.lang.ClassCastException: org.eclipse.uml2.uml.internal.impl.AssociationImpl cannot be cast to org.eclipse.gmf.runtime.notation.View
	at org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand.doExecuteWithResult(DuplicateViewsCommand.java:131)
	at org.eclipse.papyrus.uml.diagram.common.commands.PapyrusDuplicateViewsCommand.doExecuteWithResult(PapyrusDuplicateViewsCommand.java:85)
	at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68)
	at org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy.doExecuteWithResult(CommandProxy.java:50)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper.execute(GMFtoEMFCommandWrapper.java:118)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	at org.eclipse.papyrus.commands.CheckedOperationHistory.execute(CheckedOperationHistory.java:182)
	at org.eclipse.papyrus.commands.NotifyingWorkspaceCommandStack.doExecute(NotifyingWorkspaceCommandStack.java:252)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.papyrus.uml.diagram.common.providers.PapyrusDiagramGlobalActionHandler.getCommand(PapyrusDiagramGlobalActionHandler.java:119)
	at org.eclipse.gmf.runtime.common.ui.action.global.GlobalAction.doRun(GlobalAction.java:109)
	at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler.run(AbstractActionHandler.java:359)
	at org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run(ActionManager.java:225)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(ActionManager.java:223)
	at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler.runWithEvent(AbstractActionHandler.java:377)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2545)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1433)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1409)
Comment 2 Sébastien Gérard CLA 2013-04-15 11:58:00 EDT
Papyrus shall enable to copy/past model elements between views and model explorer:
1. Copy in model explorer, paste in diagram [=> should be a visual copy, as in dragging of model explorer elements]
2. Copy in model explorer, paste with model in diagram [=> should be a model + visual copy]
3. Copy in diagram, paste in model explorer [=> should be a model copy]
Comment 3 Ronan Bar CLA 2014-03-18 18:36:05 EDT
Some feedback for M6:

#1 Does not work. In fact a copy from Model Explorer and then paste to diagram (highlight diagram and then paste via main menu) causes a comment element to be created in the diagram and the Model Explorer. 

#2 Does not work. Copy from Model Explorer and then paste to diagram (highlight diagram and then paste via context menu) causes a new element to be created in the Model Explorer and no change to the diagram. 

#3 Does not work.
Comment 4 Tristan Faure CLA 2014-03-27 05:54:55 EDT
another additional use cases :
- copy in papyrus, paste in UML Tree editor (to ensure compatibility with other eclipse tools)

suggestion :
- implement URL transfer to insert the URI of the eobject
Comment 5 Tristan Faure CLA 2014-03-27 05:55:14 EDT
another additional use cases :
- copy in papyrus, paste in UML Tree editor (to ensure compatibility with other eclipse tools)

suggestion :
- implement URL transfer to insert the URI of the eobject
Comment 6 Ronan Bar CLA 2014-05-14 05:23:49 EDT
In M7 my issues in Comment #3 have been fixed. The use-case #1 actually performs a model copy but I think this is fine. Is it actually possible to have just a visual copy via cut and paste from model explorer to diagram?