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

Bug 529992

Summary: Improve Sirius Popup Menu contributions
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED FIXED QA Contact: Laurent Redor <laurent.redor>
Severity: enhancement    
Priority: P3 CC: julien.dupont, pierre.guilet
Version: 5.1.0Keywords: triaged
Target Milestone: 5.1.2   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/121152
https://git.eclipse.org/r/121366
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=41262564155c59570f6a40146313368797c7886e
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bb1e189d37cc4722da4b24f22b930c5fac4236ea
Whiteboard:
Bug Depends on:    
Bug Blocks: 533654, 534301, 534302    
Attachments:
Description Flags
currentBehavior.png
none
newSeparator.png
none
newActionsInExistingMenu.png
none
POC_contextualMenu.png
none
Project org.eclipse.sirius.sample.popupmenu
none
contextualMenu_withoutPOC.png none

Description Laurent Redor CLA 2018-01-18 09:01:39 EST
Created attachment 272328 [details]
currentBehavior.png

In the VSM (odesign file), you can contribute popup menu [1] which can contain actions ([2] and [3]) --> currentBehavior.png.

The goal of this issue is to improve this feature:
* Capability to define separator (in a defined popup menu or directly at the root of the contextual menu to isolate some specific actions) --> newSeparator.png
* Capability to define actions, and separators, in an existing menu --> newActionsInExistingMenu.png
* Capability to define the insertion point of the popup menu or of the actions. A bit like what is done for the extension point org.eclipse.ui.menus [4].
* If a popup menu id corresponds to an existing menu, the existing menu could be reused instead of creating a new one.

This evolution could be associated to another feature requests:
* bug 484309 - Make possible to disable some default actions in representations context menu
* bug 475257 - Add the ability to add an icon to the popup menu

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#popup_menu
[2] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#operation_action
[3] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#external_java_action
[4] https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_cmd_menus.htm
Comment 1 Laurent Redor CLA 2018-01-18 09:01:57 EST
Created attachment 272329 [details]
newSeparator.png
Comment 2 Laurent Redor CLA 2018-01-18 09:02:12 EST
Created attachment 272330 [details]
newActionsInExistingMenu.png
Comment 3 Laurent Redor CLA 2018-01-19 03:10:20 EST
Another improvement will be to contribute additional actions to existing menus to the tabbar. A first need would be to add selection actions to the "Select All" menu of the tabbar.
Comment 4 Eclipse Genie CLA 2018-04-13 11:53:09 EDT
New Gerrit change created: https://git.eclipse.org/r/121152
Comment 5 Laurent Redor CLA 2018-04-13 11:57:05 EDT
Created attachment 273595 [details]
POC_contextualMenu.png

POC_contextualMenu.png: Result that can be observed with the sample project org.eclipse.sirius.sample.popupmenu and the above gerrit.
Comment 6 Laurent Redor CLA 2018-04-13 12:05:46 EDT
Created attachment 273596 [details]
Project org.eclipse.sirius.sample.popupmenu

Project org.eclipse.sirius.sample.popupmenu: Sample project that uses documentation property of "Popup Menu" and "Operation Action" to utilize the new mechanism offered by the above POC. A documentation will be added later to explain what is possible to do.
This POC demonstrates what is possible to do.
Comment 7 Laurent Redor CLA 2018-04-17 03:37:39 EDT
Created attachment 273638 [details]
contextualMenu_withoutPOC.png

contextualMenu_withoutPOC.png: Same contextual menu but without the POC enabled. All the menu are at the end of the contextual menu and without group.
Comment 8 Laurent Redor CLA 2018-04-18 04:38:06 EDT
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/121152

This gerrit is a POC and to be activated the VM argument "-Dorg.eclipse.sirius.experimental.popupMenuImprovement=true" must be added.

It currently does not covered this part of initial description:

> * Capability to define the insertion point of the popup menu or of the actions. A bit like what is done for the extension point org.eclipse.ui.menus [4].
Comment 9 Eclipse Genie CLA 2018-04-18 13:02:16 EDT
New Gerrit change created: https://git.eclipse.org/r/121366
Comment 10 Laurent Redor CLA 2018-04-19 09:25:20 EDT
(In reply to Laurent Redor from comment #3)
> Another improvement will be to contribute additional actions to existing
> menus to the tabbar. A first need would be to add selection actions to the
> "Select All" menu of the tabbar.
It is now possible with the above gerrit (see bug 533654 comment 6 to see how to test it).
Comment 11 Pierre Guilet CLA 2018-04-19 11:46:33 EDT
(In reply to Laurent Redor from comment #10)
> (In reply to Laurent Redor from comment #3)
> > Another improvement will be to contribute additional actions to existing
> > menus to the tabbar. A first need would be to add selection actions to the
> > "Select All" menu of the tabbar.
> It is now possible with the above gerrit (see bug 533654 comment 6 to see
> how to test it).

A tooltip now appears with the gerrit when using the tabbar to execute a select all action when the functionality is activated with the system property.

This is OK for the POC but a better solution should be found later.
Comment 14 Laurent Redor CLA 2018-04-27 09:52:48 EDT
Currently, the work on this POC is interrupted. The first iteration is considered as ended.
Comment 15 Laurent Redor CLA 2018-05-31 11:31:03 EDT
Another issue will be created to continue the work on this subject. So I close this issue as resolved.
Comment 16 Laurent Redor CLA 2018-05-31 11:31:39 EDT
There is no real validation as it is a POC.
Comment 17 Laurent Redor CLA 2018-06-28 12:11:03 EDT
Available in Sirius 5.1.2, see https://wiki.eclipse.org/Sirius/5.1.2 for details