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

Bug 459783

Summary: Improve cursor feedback when dropping an element from the Project Explorer on a diagram
Product: [Modeling] Sirius Reporter: Nathalie Lepine <nathalie.lepine>
Component: DiagramAssignee: Steve Monnier <steve.monnier>
Status: CLOSED FIXED QA Contact: Belqassim Djafer <belqassim.djafer>
Severity: normal    
Priority: P3 CC: claudiai, donp, florian.barbin, laurent.redor, pierre-charles.david, steve.monnier
Version: 2.0.0Keywords: triaged
Target Milestone: 2.0.5   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/41740
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=51caff64adb3eb051b938c6afc4e4778d130c67a
https://git.eclipse.org/r/43657
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=eea990666ab364ddb6e1b6d575eee15774f92480
Whiteboard:
Bug Depends on:    
Bug Blocks: 460900, 461981    
Attachments:
Description Flags
Reproduction sample none

Description Nathalie Lepine CLA 2015-02-12 09:27:43 EST
The cursor used is the move one. User should choose the cursor style they want, DND.DROP_MOVE, DROP_COPY or DROP_LINK
Comment 1 Eclipse Genie CLA 2015-02-12 10:02:38 EST
New Gerrit change created: https://git.eclipse.org/r/41740
Comment 2 Nathalie Lepine CLA 2015-02-12 10:05:04 EST
draft on commit 0029929442f53940e1d1f105894b079a7cd9d214
Comment 3 Nathalie Lepine CLA 2015-02-12 10:15:25 EST
Just replace the move cursor by copy cursor.

"When dropping another model, such as from the Project Explorer, onto a Sirius diagram, the default drop operation should be a copy. This is because the original will not be affected, and only a copy of that model will be created in the model that the diagram is based on. Additional code would be required to support the Move, and Link options. 

A Move operation would imply that the original model file in the workspace be deleted after a successful copy.

A Link operation would imply that any future changes to the model file would be automatically made in the diagram model as well, and that any changes made to the embedded model that was dropped would get reflected back in the original file."
Comment 4 Pierre-Charles David CLA 2015-02-26 03:21:18 EST
I'm changing the title as the patch does not offer any control to the user/specifier on which cursor to use, but simply hard-codes a different (and more adapted) one.

Giving the specifier control on which mouse cursor to use for which tool could be a further step, but it would imply changing the metamodels so it is not possible for a maintenance version.
Comment 6 Pierre-Charles David CLA 2015-02-27 03:58:48 EST
Fixed (confirmed by Nathalie).
Comment 7 Pierre-Charles David CLA 2015-02-27 10:24:58 EST
It looks like the patch does not just change the look of the cursor, but by changing the declared nature of the dnd event it causes regressions: at least under Juno, dnd from a table to a diagram does not work anymore with the patch applied.
Comment 8 Pierre-Charles David CLA 2015-02-27 11:00:39 EST
The regression is also on Kepler.

To reproduce:
1. open both a table and diagram in the same session, with a drop tool in the diagram which accepts the elements from the table.
2. put both editors along each other.
3. try to drop an element from the table in the diagram: the drop is refused.
Comment 9 Eclipse Genie CLA 2015-03-11 05:51:14 EDT
New Gerrit change created: https://git.eclipse.org/r/43657
Comment 10 Steve Monnier CLA 2015-03-11 05:54:44 EDT
Created attachment 251455 [details]
Reproduction sample

The sample can be used to reproduce the regression presented at https://bugs.eclipse.org/bugs/show_bug.cgi?id=459783#c8
Comment 12 Steve Monnier CLA 2015-03-24 05:44:23 EDT
Fixed
Comment 13 Laurent Redor CLA 2015-03-30 05:46:36 EDT
Verified on Sirius 2.0.5 [1]

[1] http://download.eclipse.org/sirius/updates/stable/2.0.5-S20150321-000123
Comment 14 Laurent Redor CLA 2015-03-31 10:20:54 EDT
Available in Sirius 2.0.5.