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

Bug 527676

Summary: Double click tools not immediately available in diagrams when defined in VSM in same workspace
Product: [Modeling] Sirius Reporter: Pierre Guilet <pierre.guilet>
Component: CoreAssignee: Laurent Fasani <laurent.fasani>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, laurent.fasani, pierre-charles.david
Version: 5.0.0Keywords: triaged
Target Milestone: 5.1.1   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/112168
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=37d0f3915629953b66bd6d1a33cff40c8afa390d
Whiteboard:
Attachments:
Description Flags
project to reproduce none

Description Pierre Guilet CLA 2017-11-23 08:05:34 EST
Created attachment 271609 [details]
project to reproduce

When defining a double click tool on a VSM, it is not immediately available on diagram in the same workspace using this VSM.
The diagram must be reopened.

Steps to reproduce:

1-import attached project
2- Open the VSM and the representation
3- Create a double click tool with "class mapping", a change context "var:element", a set operation with feature "name" and the expression "aql:'test'"
4- Double click on C1 class diagram element. KO the name is not change to test.
5- Reopen the diagram and double click on C1, the name is updated.
Comment 1 Eclipse Genie CLA 2017-11-23 08:09:39 EST
New Gerrit change created: https://git.eclipse.org/r/112168
Comment 2 Pierre-Charles David CLA 2017-12-26 10:30:42 EST
The fix is small enough and the problem frustrating enough that it seem worth having in 5.1.x, which will be widely deployed.
Comment 3 Pierre-Charles David CLA 2017-12-26 10:53:16 EST
While testing this I could not understand why I could not reproduce it even without the fix. After investigation, this was apparently already fixed as a side-effect (probably unintended) of the fix for bug #527109, which also modifies DoubleClickEditPolicyProvider.java. See https://git.eclipse.org/r/#/c/112875/8/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java.

The change committed there is actually more heavy-handed than the one prepared for this: the edit policy provider's now returns true for all DDiagramElements and does not check for the presence of a double-click tool. This test will be done at invocation-time in DoubleClickEditPolicy.getOpenCommand(Request), which actually seems simpler and cleaner than the strange check for diagramElementMapping.eResource().getURI().isPlatformResource().

I'll merge the test part of this and mark as fixed, but without the original change in DoubleClickEditPolicyProvider.java.
Comment 5 Pierre-Charles David CLA 2017-12-27 03:44:51 EST
Test added by 37d0f3915629953b66bd6d1a33cff40c8afa390d.
Comment 6 Laurent Fasani CLA 2018-01-08 04:38:44 EST
being homologated...
Comment 7 Laurent Fasani CLA 2018-01-08 05:56:34 EST
Validated with Sirius 5.1.1rc2
Comment 8 Pierre-Charles David CLA 2018-02-01 03:25:47 EST
Available in Sirius 5.1.1. See https://wiki.eclipse.org/Sirius/5.1.1 for details.