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

Bug 349423

Summary: [Compatibility] 'Source' and 'Refactor' menus disappear after installing Photran
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: critical    
Priority: P3 CC: pwebster
Version: 4.1   
Target Milestone: 4.2 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 344260    
Attachments:
Description Flags
ContributionRecord patch v1
none
ContributionRecord patch v2
none
ContributionRecord patch v3 none

Description Remy Suen CLA 2011-06-15 08:43:59 EDT
After installing Photran from Indigo and restarting, the 'Source' and 'Refactor' menus no longer show up when the 'Package Explorer' is the active part. If I select something in the view the 'Refactor' menu shows up but the 'Source' menu does not.
Comment 1 Remy Suen CLA 2011-06-15 09:51:30 EDT
This is with I20110614-1545.
Comment 2 Paul Webster CLA 2011-06-15 15:07:00 EDT
Can you see them when the Java Editor is active?

PW
Comment 3 Remy Suen CLA 2011-06-15 16:05:31 EDT
(In reply to comment #2)
> Can you see them when the Java Editor is active?

There's not a problem there. The 'Source' menu doesn't have separators though (you saw this on my screen yesterday).
Comment 4 Remy Suen CLA 2011-09-08 13:59:09 EDT
This snippet will induce the problem in an inner.

<extension point="org.eclipse.ui.menus">
  <menuContribution
      locationURI="menu:org.eclipse.ui.main.menu?after=edit">
    <menu
        label="&amp;Source"
        id="org.eclipse.jdt.ui.source.menu">
      <visibleWhen checkEnabled="false">
        <!-- ... -->
      </visibleWhen>
      <separator name="commentGroup" />
    </menu>
  </menuContribution>
</extension>
Comment 5 Remy Suen CLA 2011-09-08 16:30:13 EDT
Created attachment 203030 [details]
ContributionRecord patch v1

When we find the same menu, we just reference it directly and don't actually create any OR clauses between them. This is just an illustrative patch as we should also be considering the cloned one's expression (if any) since this patch only merges the pre-existing menu's expression with the menu contribution's.

In any case, the problem in question goes away with this patch.
Comment 6 Remy Suen CLA 2012-01-16 09:55:11 EST
Created attachment 209560 [details]
ContributionRecord patch v2

Updates the patch against master as well as adding code to exclude expressions if one of the two elements don't have an expression defined.
Comment 7 Remy Suen CLA 2012-01-19 10:38:04 EST
Created attachment 209752 [details]
ContributionRecord patch v3

The patch couldn't be applied cleanly for whatever reasons. This one should work.
Comment 8 Remy Suen CLA 2012-01-19 13:40:14 EST
(In reply to comment #7)
> Created attachment 209752 [details]
> ContributionRecord patch v3

Patch pushed to master.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=4bdf5a7dd4ea646015bf114a8fa18f0a5974dd7e
Comment 9 Remy Suen CLA 2012-01-24 10:59:14 EST
Verified with I20120123-2200 on Windows 7 that the 'Source' and 'Refactor' menus no longer magically disappear!