Bug 407166 - IActivityPatternBinding not filtering contributed menu items
Summary: IActivityPatternBinding not filtering contributed menu items
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.3 RC1   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 359778 381765
Blocks:
  Show dependency tree
 
Reported: 2013-05-03 08:59 EDT by Paul Webster CLA
Modified: 2013-05-17 10:32 EDT (History)
6 users (show)

See Also:
curtis.windatt.public: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2013-05-03 08:59:43 EDT
Make sure this gets into Kepler.

+++ This bug was initially created as a clone of Bug #381765 +++

Build Identifier: I20120531-1500

I have an activity defined using patterns that hides menu items which previously works with 3.6->3.8.  I see my contributed capability listed, but the menu items that match the pattern do not get removed.  

For instance, I am testing with trying to hide the update menu item from p2.  It is defined in it's plugin org.eclipse.equinox.p2.ui.sdk as:

   <extension
         point="org.eclipse.ui.commands">
      <command
            name="%Update.command"
            id="org.eclipse.equinox.p2.ui.sdk.update">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:help?after=additions">
            <command
                  commandId="org.eclipse.equinox.p2.ui.sdk.update"
            	  mnemonic="%Update.command.mnemonic"
                  id="org.eclipse.equinox.p2.ui.sdk.update">
            </command>
      </menuContribution>
   </extension>

In my plugin, I am trying to filter it out using any series of combinations including:

      <activityPatternBinding
            activityId="my.test.activity"
            isEqualityPattern="false"
            pattern="org\.eclipse\.equinox\.p2\.ui\.sdk/org\.eclipse\.equinox\.p2\.ui\.sdk\.update">
      </activityPatternBinding>

with other combinations attempted including some that would appear wrong based on documentation:

.*/org\.eclipse\.equinox\.p2\.ui\.sdk\.update
org\.eclipse\.equinox\.p2\.ui\.sdk/.*
.*/org\.eclipse\.equinox\.p2\.ui\.sdk\.update

I debugged MutableActivityManager and I do not see any of the menu items from the target plugin being queried for.  Certainly I am potentially looking in the wrong code, but ostensibly I see other menu items like file open, etc. being correctly iterated.

As this is a one of the key roles for activity bindings, I believe this is a priority issue for release.  Other E4 references imply this would be the correct approach, such as:

http://dev.eclipse.org/mhonarc/lists/ide4edu-dev/msg00155.html

Reproducible: Always

Steps to Reproduce:
1. Add activity via plugin.xml matching to an existing contributed menu item
2. Make sure the capability (activity) is turned off in Preferences
3. Confirm menu item is still visible, restart Eclipse, and confirm again

I will tidy up a bit my test plugin and attach to this bug shortly.
Comment 1 Paul Webster CLA 2013-05-07 08:50:23 EDT
Hook up activity identifiers and menu/tool item visibility through the IEclipseContext.  https://git.eclipse.org/r/#/c/12578/

PW
Comment 3 Paul Webster CLA 2013-05-17 10:32:43 EDT
In 4.3.0.I20130516-2200

PW