Community
Participate
Working Groups
I200411230800 I'm asking for a hook so that I can modify the sub menu label of the global (Search >) Occurrences in File sub menu. Background: We started to add quick menus e.g. for Source, Refactoring and now Occurrences in File (Ctrl+Shift+U). I was able to add the key sequence to the sub menu label in the context menu but found no way to achieve this for the global Search > Occurrences in File sub menu entry. Note: There's already a key binding being shown for a global sub-menu: File > New Alt+Shift+N Dirk told me that this is currently hard coded somewhere in Platform UI code.
I'm confused, as I don't see a sub-menu for "Occurrences in File" ("Search > Occurrences in File") in the global menu. I only see a menu item. Then you go on to mention a context menu. Which do you mean? Is this meant to become a menu? Is the menu supposed to be dynamic? If it is a dynamic menu, then this should be relatively easy. You can just take a snippet from the Debug UI's plug-in and add a definitionId: <action label="%RunWithConfigurationAction.label" pulldown="true" helpContextId="run_with_configuration_action_context" class="org.eclipse.debug.internal.ui.actions.RunAsAction" definitionId="org.eclipse.ui.file.refresh" menubarPath="org.eclipse.ui.run/runGroup" id="org.eclipse.debug.internal.ui.actions.RunWithConfigurationAction"> </action> The definition id should point to the command that will have the key binding, and will open the quick menu. If you the menu is purely static, then it won't work. You're left with the (rather icky) option of changing it to be a dynamic menu that always has the same entries. :( This also has the negative side effect of causing early plug-in loading. :( :( We are looking to overhaul contributions, and I will try to consider this as part of that work. Please see Bug 36968 and Bug 45879.
>I'm confused, as I don't see a sub-menu for "Occurrences in File" ("Search > >Occurrences in File") in the global menu. See comment 0: build id: I200411230800 ;-) Alternatively you can take JDT UI from HEAD or latest N-build. The only thing which is not working is displaying the shortcut for the sub menu in the global menu.
Heh. I missed that, but as of yet I can't travel in time. So, I'll just grab JDT UI.
Yeah, my comment still stands. Static menu, so you should probably just wait for the new contributions stuff. How does the refactor quick menu work get its key binding then?
>How does the refactor quick menu work get its key binding then? The key sequence is shown (and the key binding works) for my quick menus in context menus, this PR is about showing the key sequence in my quick menu in the global menu bar. The Refactor and Source menus are top-level in the global menu bar and it would look strange to show the key sequence there wouldn't it? Hence I don't quite understand your question.
I'm just asking how you guys get it to work in the context menu.
For example you can take a look at the OccurrencesSearchGroup: adapts the context menu (see fillContextMenu(...)) and also contains the QuickAccessAction.
Dani: side note. I've picked up today's integration build, and I must confess I am a little bit put-off by the new effect for the "Ctrl+Shift+U" key binding. I'm quite used to using the key combination to quickly scan for uses of a variable within a file. Is there a way to not get prompted with that quick menu?
>Is there a way to not get prompted with that quick menu? Sure. Simply reassign Ctrl+Shift+U to Find Occurrences in file command and - if you like - asssign a new shortcut to the Quick Menu.
I've changed the menu into a dynamic one in N20060421-0010:-( I hope I can revert that in 3.3?
Moving Dougs bugs
Assigning to component owner PW
Dani, there is now API on MenuManager (setActionDefinitionId() :-) so that the small dynamic subclasses are no longer necessary to display a quick menu shortcut for a submenu (they can use the same command ID that is bound to the quick menu launcher). This is also available for menus created by the the org.eclipse.ui.menus extension point. PW
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.