Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345094 - [Compatibility] ShowViewMenu contribution item doesn't show all entries
Summary: [Compatibility] ShowViewMenu contribution item doesn't show all entries
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1.1   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-09 03:29 EDT by Joachim Mairböck CLA
Modified: 2011-08-26 14:26 EDT (History)
2 users (show)

See Also:


Attachments
Patch against v20110504-1730 (1.63 KB, patch)
2011-05-09 09:42 EDT, Joachim Mairböck CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Mairböck CLA 2011-05-09 03:29:09 EDT
I have a problem in an RCP application running on the Compatibility layer with the ShowViewMenu contribution item (created in ApplicationActionBarAdvisor via ContributionItemFactory.VIEWS_SHORTLIST). It is added directly to the window menu because there are just two views to show (Console and Properties).

Normally the window menu should look like this:
 - Console
 - Properties
 - Separator
 - Other
 - Preferences (this is a normal action)

When running on Eclipse 4.1, it only shows the first entry (Console) and nothing else, not even the Preferences action. When removing the contribution item, the Preferences action is visible as it should be. When putting the contribution item after the Preferences action, both Preferences and Console are visible, but still not the others.

Is this related to or caused by Bug 316470?
Comment 1 Remy Suen CLA 2011-05-09 08:53:07 EDT
If you change the code so that ShowViewMenu's 'dirty' field is removed and isDirty() always returns 'true', does the problem go away?
Comment 2 Paul Webster CLA 2011-05-09 09:18:11 EDT
Also, check your error log at <runtime-workspace>/.metadata/.log (or in your RCPapp/configuration directory, or add -consoleLog).  Are there any errors?  If there are no more menu items after the first one you included, sounds like we stopped rendering them for some reason (maybe an exception?)

PW
Comment 3 Joachim Mairböck CLA 2011-05-09 09:37:00 EDT
There were no corresponding exceptions in the log, just the menu were not there.
Comment 4 Joachim Mairböck CLA 2011-05-09 09:42:41 EDT
Created attachment 195069 [details]
Patch against v20110504-1730

Remy Suen, your suggested fix works indeed. Thank you for the quick response! I'll attach a patch with my changes. The patch is agaist the v20110504-1730 tag, the version I am currently using.
Comment 5 Remy Suen CLA 2011-05-09 11:25:32 EDT
(In reply to comment #4)
> Remy Suen, your suggested fix works indeed.

Thanks for verifying.

This must be the problem where the MenuManager's update(boolean, boolean) method is called twice.
Comment 6 Paul Webster CLA 2011-07-14 07:08:38 EDT
Remy, did we get this?

PW
Comment 7 Remy Suen CLA 2011-07-14 07:28:27 EDT
(In reply to comment #6)
> Remy, did we get this?

I just checked, no, it is still a problem.
Comment 8 Remy Suen CLA 2011-07-18 09:33:47 EDT
Fix released to R4_development as 3c21dc24a4f8384529055e64e834acc87d2c4c1f.

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=3c21dc24a4f8384529055e64e834acc87d2c4c1f
Comment 9 Remy Suen CLA 2011-08-26 14:26:20 EDT
Verified by source inspection with M20110817-2001.