This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 375221 - [Compatibility] 'Resource configurations' menu shows up in context menus
Summary: [Compatibility] 'Resource configurations' menu shows up in context menus
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.3 M6   Edit
Assignee: Paul Elder CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 375982 392249 (view as bug list)
Depends on:
Blocks: 331444
  Show dependency tree
 
Reported: 2012-03-23 18:50 EDT by Marc-André Laperle CLA
Modified: 2013-03-12 14:30 EDT (History)
6 users (show)

See Also:


Attachments
Merge into one menuContribution (4.62 KB, patch)
2012-09-23 02:36 EDT, Marc-André Laperle CLA
no flags Details | Diff
Proposed Fix (891 bytes, patch)
2013-02-11 16:26 EST, Paul Elder CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2012-03-23 18:50:22 EDT
Using 4.2.0.I20120315-1300 (M6)

1. Install CDT on 4.2M6 or use the EPP CPP package Juno M6.
2. The Resource configurations menu shows up in several places it shouldn't: Outline, Vertical ruler, Overview ruler, Breakpoints view, Variables view and more.

This looks similar to Bug 352380 but I'm not entirely sure it's the same cause.
Comment 1 Paul Webster CLA 2012-04-25 15:20:22 EDT
I've got rid of the empty team menu, but Resource Configurations still shows up at the bottom of all of my breakpoints (Java and C) and has 2 disabled items in it.

Marc-Andre, do you know where this has been defined?

PW
Comment 2 Marc-André Laperle CLA 2012-04-26 21:51:07 EDT
It's in org.eclipse.cdt.ui/plugin.xml
around line 4330:

  <menuContribution
          locationURI="popup:org.eclipse.ui.popup.any?after=buildGroup">
        <menu
             id="org.eclipse.cdt.ui.buildConfigContributionM"
             label="%ResourceConfigurations.menu">

...

and there's another one right after that:

 <menuContribution
          locationURI="popup:org.eclipse.ui.popup.any?after=additions">
       <menu
             id="org.eclipse.cdt.ui.buildConfigContributionM"
             label="%ResourceConfigurations.menu">
...
Comment 3 Marc-André Laperle CLA 2012-05-15 22:47:40 EDT
*** Bug 375982 has been marked as a duplicate of this bug. ***
Comment 4 Torkild Resheim CLA 2012-06-01 06:22:47 EDT
This is pretty annoying. For some reason it shows up a totally non-related context menu that I've created for one of my views. Strangely enough the "Team" menu also shows up. Using version: 4.2.0 Build id: I20120518-2145 (M7).
Comment 5 Greg Watson CLA 2012-06-04 09:47:30 EDT
Hi, is anyone looking at this for Juno? In my view this should be a "major" bug as it causes CDT to break the "Do No Harm" requirement of the simultaneous release. In particular it pollutes a number of PTP views with the "Resource configurations" menu, which is very confusing to users.
Comment 6 Paul Webster CLA 2012-06-04 10:03:55 EDT
This has been deferred to 4.2.1.

Our priority was missing menu items first.  Extra ones are annoying, but don't represent completely disabled functionality.

PW
Comment 7 Paul Webster CLA 2012-06-04 13:27:29 EDT
We get into this state because when we process the 2 menu contributions we merge the first MMenu visibleWhen with the second menuContribution visibleWhen, instead of the and of the second menuContribution visibleWhen and its MMenu visibleWhen.

That leaves this MMenu always visible.

PW
Comment 8 Greg Watson CLA 2012-09-06 09:01:45 EDT
Does this mean we won't see a fix for this in SR1 now? This is extremely confusing to our users and destroys any context for our views. In my opinion this is a serious regression in 4.x and needs to be fixed as a priority.
Comment 9 Paul Webster CLA 2012-09-10 08:03:44 EDT
(In reply to comment #8)
> Does this mean we won't see a fix for this in SR1 now? This is extremely
> confusing to our users and destroys any context for our views. In my opinion
> this is a serious regression in 4.x and needs to be fixed as a priority.

Correct, this won't be in SR1 (and given the length of the 4.2.2 list it might not make it into SR2).

PW
Comment 10 Marc-André Laperle CLA 2012-09-23 02:36:17 EDT
Created attachment 221384 [details]
Merge into one menuContribution

From what I understand of the 2 menu contributions, the second one (activeMenuEditorInput) is supposed to show it in the editor. Except, even on 3.6, 3.7, 3.8, it doesn't show up. "Exclude from build" is in the editor context menu in 3.5.2 so it looks like this might've been lost with bug 309579. Andrew, sorry for adding you as CC but can you confirm that "Resource Configurations" is supposed to show up in the editor context menu and was not removed willingly?

If that's the case, we can work around the platform bug (menuContribution merging) and also fix a CDT bug (menu absent on 3.x) by moving everything in the same menu contribution, see attached patch.
Comment 11 Andrew Gvozdev CLA 2012-09-23 06:06:37 EDT
(In reply to comment #10)
> From what I understand of the 2 menu contributions, the second one
> (activeMenuEditorInput) is supposed to show it in the editor. Except, even on
> 3.6, 3.7, 3.8, it doesn't show up. "Exclude from build" is in the editor context
> menu in 3.5.2 so it looks like this might've been lost with bug 309579. Andrew,
> sorry for adding you as CC but can you confirm that "Resource Configurations" is
> supposed to show up in the editor context menu and was not removed willingly?
Probably it should appear although I think it is minor. It is more important in Project Explorer view. I think it is less likely a user would navigate to "Resource Configurations" from editor.
Comment 12 Marc-André Laperle CLA 2012-10-11 01:10:19 EDT
I have committed the patch to CDT 8_1 and master branches. I tested it with 3.8.1 and 4.3.0-I20121009-0800. Paul, do you want to keep this opened since there is still a bug in the Platform or should we mark this as resolved?
Comment 13 Paul Webster CLA 2012-10-11 10:10:54 EDT
(In reply to comment #12)
> I have committed the patch to CDT 8_1 and master branches. I tested it with
> 3.8.1 and 4.3.0-I20121009-0800. Paul, do you want to keep this opened since
> there is still a bug in the Platform or should we mark this as resolved?

Let's leave this open, since we still need to fix the Platform UI part of this bug.

PW
Comment 14 Andrew Gvozdev CLA 2012-10-25 16:11:03 EDT
*** Bug 392249 has been marked as a duplicate of this bug. ***
Comment 15 Paul Elder CLA 2013-02-11 16:26:57 EST
Created attachment 226878 [details]
Proposed Fix

This fix correctly merges visibleWhen clauses from duplicate menu contributions.

Note that the merge behavior is still not 100% compatible with 3.x. In 3.x, then locationURI of the last contribution appears to be the one used, whereas in 4.3, it is that of the first contribution.
Comment 16 CDT Genie CLA 2013-02-27 11:53:19 EST
*** cdt git genie on behalf of Marc-Andre Laperle ***

    Bug 375221 - [4.x] Resource config menu shows up in context menus

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=b1a7526c66ea40b4c7c80992723c505cdb93edfe
Comment 17 CDT Genie CLA 2013-02-27 11:53:22 EST
*** cdt git genie on behalf of Marc-Andre Laperle ***

    Bug 375221 - [4.x] Resource config menu shows up in context menus

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d9928b76614d45d64644069e350bd39df4f80655
Comment 19 Paul Elder CLA 2013-03-12 14:30:21 EDT
Verified in 4.3.0.I20130311-2000