Community
Participate
Working Groups
Build ID: I20081209-0100 Steps To Reproduce: 1. Open the CustomizePerspectiveDialog 2. Open the Menu Visibility tab. 3. Uncheck the "New" menu, under the "File" menu. 4. Expand the "New" menu, check "Java Project from Existing Ant Buildfile" 5. Click "Ok". The File > New menu is not visible. More information: It looks like our logic for determining whether to show menus doesn't take the Wizards into account?
This problem also exists in the Window > Show View and Window > Open Perspective menus - i.e. it is general to shortcuts.
This problem was aggravated by bug 258158 as all the duplicate menu items had the same id - if any one of them was turned off, they were all turned off. The root of the problem is that the New menu (and Open Perspective and Show View) has children contribution items: two separators and the "Other..." menu item, but the new wizards (and perspectives and views) are not contribution items. Thus when the code in MenuManager::isVisible executes, if one has hidden the "Other..." menu item, there are no other non-separator visible children, so the New menu is not displayed, despite having potential new wizards to list. The fix for bug 258158 is a bit of a hack to only show the "Other..." menu item to the user (i.e. filter out the other menu items, but inject the new wizards which are determined independently). I think the easiest fix for this bug is a modification of the fix for 258158 - simply don't give the user the option to hide the "Other..." menu item (and equivalents for Open Perspective and Show View). These aren't items under the main menus, so the user probably doesn't desperately need to hide it. In order to hide the whole New menu, I'll have to put some special code in, but that will be straight forward. I'll rig a patch together to demonstrate...
Created attachment 120113 [details] No longer allow users to hide "Other...", and hide root menus of shortcuts instead This is the fix described above. Is is an alternative to attachment 120103 [details] in bug 258158. The main disadvantage to this approach is that if a new wizard, view or perspective is added through means other than the Customize Perspective Dialog after a user has used the Customize Perspective Dialog to hide the New, Open Perspective or Show View menu, said menu will not regain visibility for the new item, as this is operating as an exception to the rule employed in the CPD that parent visibility is calculated from child visibility - in this case the visibility of the parent itself is stored as it cannot be reliably calculated from the children.
Matt, let's get together on Monday to go over the various scenarios...
Created attachment 120575 [details] Final fix Eric and I discussed this patch and the patch in bug 258158, and decided to use this one. I've added a comment explaining a portion of the code which seemed out of place. Changes: - Don't give users the option to hide "Other..." in shortcuts - it won't be listed in the CPD. - The mechanism to hide the menus shortcuts are in is to record the menu's id itself.
*** Bug 258158 has been marked as a duplicate of this bug. ***
Committed in >20081216. Applied Matt's patch. I'll take ownership to verify...
Marking as FIXED.
Verified in I20090127-0100.