Bug 543522 - Group Menu Tool: unable to insert menu in "New" menu
Summary: Group Menu Tool: unable to insert menu in "New" menu
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 6.1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.2.0   Edit
Assignee: Laurent Redor CLA
QA Contact: Florian Barbin CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 543909
  Show dependency tree
 
Reported: 2019-01-17 08:14 EST by Axel RICHARD CLA
Modified: 2019-04-01 05:52 EDT (History)
3 users (show)

See Also:


Attachments
TestGroup.zip (4.59 KB, application/x-zip-compressed)
2019-01-24 02:20 EST, Laurent Redor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel RICHARD CLA 2019-01-17 08:14:22 EST
It is not possible to insert a menu entry in the "New" right-click menu (the one to create new diagrams, first in the right-click menu of a diagram element) .

The value for the locationURI attribute of such Group menu should be : "menu:popup.new".

I think the problem comes from /org.eclipse.sirius.diagram.ui/plugin.xml

In this plugin.xml file, if you change the order of item contributions from :

<contributionItemProvider
   checkPluginLoaded="false"
   class="org.eclipse.sirius.diagram.ui.tools.internal.menu.SubDiagramMenu">
   <Priority name="Highest"/>
</contributionItemProvider>
<contributionItemProvider
   checkPluginLoaded="false"
   class="org.eclipse.sirius.diagram.ui.tools.internal.menu.PopupMenuContribution">
   <Priority name="High"/>
</contributionItemProvider>

to :

<contributionItemProvider
   checkPluginLoaded="false"
   class="org.eclipse.sirius.diagram.ui.tools.internal.menu.PopupMenuContribution">
   <Priority name="Highest"/>
</contributionItemProvider>
<contributionItemProvider
   checkPluginLoaded="false"
   class="org.eclipse.sirius.diagram.ui.tools.internal.menu.SubDiagramMenu">
   <Priority name="Highest"/>
</contributionItemProvider>

The contributions have been switched, and the priority of PopupMenuContribution has been changed from High to Highest.

Then, a group menu tool with location URI : "menu:popup.new" works.
Comment 1 Laurent Redor CLA 2019-01-24 02:19:54 EST
Steps to reproduce:
* Import the project "TestGroup" from TestGroup.zip
* Open the diagram "new vp939"
* On the package "sub package", in the contextual menu check that there are:
    * An action named "myActionInGroupInTheOpenMenu" in the menu Open --> currently OK
    * An action named "myActionInGroupInTheNewMenu" in the menu New --> currently KO, a corresponding message is added in the Error Log view: 
> The group "siriusGroupInNewMenu" can not be added. The menu with the id "popup.new" has not been found.
Comment 2 Laurent Redor CLA 2019-01-24 02:20:19 EST
Created attachment 277262 [details]
TestGroup.zip
Comment 3 Eclipse Genie CLA 2019-01-24 03:52:29 EST
New Gerrit change created: https://git.eclipse.org/r/135671
Comment 4 Laurent Redor CLA 2019-01-24 05:02:18 EST
The above gerrit fixes the problem, completes the documentation for "New" and "Open" menus, and adds specific automatic tests.
Comment 6 Pierre-Charles David CLA 2019-01-28 11:44:08 EST
Fixed by 4d09fe339245eb9d6272e987bc93d14b0b046092.
Comment 7 Florian Barbin CLA 2019-02-28 08:17:13 EST
Verified with build 6.2.0.201902251539
Comment 8 Pierre-Charles David CLA 2019-04-01 05:52:04 EDT
Available in Sirius 6.2.0, see https://wiki.eclipse.org/Sirius/6.2.0 for details.