This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 386381 - Mixing Platform Command and Action Set frameworks no longer works in 4.2
Summary: Mixing Platform Command and Action Set frameworks no longer works in 4.2
Status: CLOSED DUPLICATE of bug 379495
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 4.2.2   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-01 08:28 EDT by Vladimir Piskarev CLA
Modified: 2012-11-29 16:46 EST (History)
2 users (show)

See Also:


Attachments
org.example.menu plug-in (2.94 KB, application/octet-stream)
2012-08-01 08:28 EDT, Vladimir Piskarev CLA
no flags Details
screenshot1 (71.74 KB, image/png)
2012-11-28 01:05 EST, Vladimir Piskarev CLA
no flags Details
screenshot2 (23.69 KB, image/png)
2012-11-28 01:05 EST, Vladimir Piskarev CLA
no flags Details
screenshot3 (26.07 KB, image/png)
2012-11-28 01:06 EST, Vladimir Piskarev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2012-08-01 08:28:01 EDT
Created attachment 219431 [details]
org.example.menu plug-in

Platform Command and Action Set frameworks can be mixed as suggested e.g. in this thread http://www.eclipse.org/forums/index.php/mv/msg/109158/333620. Basically, the menus and separators used in actionSets can be defined in menuContributions, and then they can be seen from both other menuContributions and from actionSets. For example:

   <extension
         point="org.eclipse.ui.commands">
      <command
            id="org.example.menu.dummyCommand"
            name="Dummy">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu?after=navigate">
         <menu
               id="org.eclipse.search.menu"
               label="Search">
            <separator
                  name="internalDialogGroup">
            </separator>
            <separator
                  name="dialogGroup">
            </separator>
            <separator
                  name="fileSearchContextMenuActionsGroup"
                  visible="true">
            </separator>
            <menu
                  id="textSearchSubMenu"
                  label="Text">
               <separator
                     name="group1">
               </separator>
               <separator
                     name="additions">
               </separator>
               <separator
                     name="group2">
               </separator>
            </menu>
            <separator
                  name="contextMenuActionsGroup"
                  visible="true">
            </separator>
            <separator
                  name="occurencesActionsGroup"
                  visible="true">
            </separator>
            <separator
                  name="extraSearchGroup"
                  visible="true">
            </separator>
            <visibleWhen>
               <with
                     variable="activeContexts">
                  <iterate
                        ifEmpty="false"
                        operator="or">
                     <equals
                           value="org.eclipse.search.searchActionSet">
                     </equals>
                  </iterate>
               </with>
            </visibleWhen>
         </menu>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.search.menu">
         <command
               commandId="org.example.menu.dummyCommand"
               style="push">
         </command>
      </menuContribution>
   </extension>

This approach works well in Eclipse 3.8, but can lead to duplicating menus in 4.2. Using the example above, there will be two top-level Search menus alongside: the first Search menu will contain the Dummy command (only), while the second will have all the usual Search contributions. In addition, when started with a new workspace, the second Search menu will have no separators. Please use the attached org.example.menu plug-in to reproduce the issue.
Comment 1 Vladimir Piskarev CLA 2012-08-01 08:34:20 EDT
Sorry, just noticed the forum link is broken. Updated link: 
 http://www.eclipse.org/forums/index.php/mv/msg/109158/333620/
Comment 2 Michael Rennie CLA 2012-11-26 17:03:21 EST
(In reply to comment #1)
> Sorry, just noticed the forum link is broken. Updated link: 
>  http://www.eclipse.org/forums/index.php/mv/msg/109158/333620/

This looks like it was fixed with bug 379495, testing in a new and existing workspace using the provided example works for me.

Vladimir, are you able to the test this in one of the N-builds? Something newer than 2012-11-21? You can grab an N-build here: http://download.eclipse.org/eclipse/downloads/ under the '4.3 Nightly Build' section.
Comment 3 Michael Rennie CLA 2012-11-27 15:05:07 EST
Marking as a duplicate of bug 379495, Vladimir, if you can still reproduce the failure using a new build - as mentioned in comment #2 - then please reopen

*** This bug has been marked as a duplicate of bug 379495 ***
Comment 4 Vladimir Piskarev CLA 2012-11-28 01:03:54 EST
It looks like I can certainly reproduce the problem in 4.3 N20121126-2000. Please see the screenshots attached.
Comment 5 Vladimir Piskarev CLA 2012-11-28 01:05:07 EST
Created attachment 224031 [details]
screenshot1
Comment 6 Vladimir Piskarev CLA 2012-11-28 01:05:39 EST
Created attachment 224033 [details]
screenshot2
Comment 7 Vladimir Piskarev CLA 2012-11-28 01:06:05 EST
Created attachment 224034 [details]
screenshot3
Comment 8 Paul Webster CLA 2012-11-28 09:03:31 EST
Oh, that build doesn't contain the fix (it was released into 4.2.2).

You can either pick up today's 4.2.2 M build at 12:00 or tonight's N build (I've released it to Kepler)

PW

*** This bug has been marked as a duplicate of bug 379495 ***
Comment 9 Vladimir Piskarev CLA 2012-11-29 00:56:14 EST
Tested in 4.2.2 M20121128-1200. The problem is no longer reproduced.
Comment 10 Michael Rennie CLA 2012-11-29 16:46:45 EST
(In reply to comment #9)
> Tested in 4.2.2 M20121128-1200. The problem is no longer reproduced.

Thanks for reporting back Valdimir.