Community
Participate
Working Groups
JDT has added shortcut menus for submenus so that they can be activated from the keyboard. For example in the Java editor you can press ALT+SHIFT+T to activate the refactoring submenu. The workbench Navigate>Show in> menu is popular but cumbersome to access and it would therefore significantly profit from a short cut menu. The proposal is that some short cuts opens the Navigate>Show in> menu as a context menu at the current cursor location. JDT can implement and contribute a patch
any suggested key combination?
we had a good short cut when we showed the views in a dialog - I think it was alt+shift+s, but this one is now taken by the source short cut menu... We will find another one or change the source short cut menu short cut...
Is Shown In really that popular? I rarely use it (I occasionally bind Ctrl+P to Show In > Package Explorer). With mnemonics, access to it is pretty quick: Alt+N, W.
Likewise, I don't see a big benefit to the shortcuts for the Source and Refactor submenus. I can get to the main menus with Alt+S and Alt+T. I think a better and more scalable way of handling these things would be to model them after the File > New submenu. Here, the submenu only shows the frequently used items, and has Other... for the rest. Other... has a keyboard shortcut. The Refactor menu in particular is getting longer, which is good, but for me anyway, there are many more there than I use regularly. Having a separate (lightweight) dialog would also afford showing a description of the refactoring.
Couple of comments: 1) "show in" isn't used as frequently as it should since it isn't easily accessible. ctrl+p (show in package explorer) is just a workaround for this problem. The show in package explorer should not be a special case. For example, you want to see a search match in the type hierarchy etc. Finally, I've used show in frequently once it was availble in a dialog and there was a short cut. 2) you miss an important point with the short cut menu for refactorings: the menu is context sensitive! Only refactorings applicable for the current selection are show in the menu. This addresses the long refactoring menu issue. Alt+T shows the refactoring menu in the full length. Also users have asked for refactorings in code-assist. ALT+SHIFT+T also addresses this issue and gives you the code assist feel. 3) the UI overhead of this feature is minimal, the only cost is that the short cut is shown in the menu bar menu. The other... is much more heavy weight and I really prefer a context sensitive solution. 4) short cut menus appear in other apps and users like them Bottom line I can only see benefits and the code change is small.
Dirk - since you have done the JDT short cut menus. Can you please also do one for Show In... and attach a patch to this bug report.
*** Bug 34257 has been marked as a duplicate of this bug. ***
(btw, Adam filed the original bug for this - so the "polish" key word is really justified <g>)
Enlcosed two patches to add short cut menus for Show In and New. The patch in jface is necessary to update the label in the menu representing the sub menu with the corresponding short cuts. I investiagted alternative implementations but rejected them due to the following reasons: - add a method setMenuText to the MenuManager: best fix but is an API change which might not go into 3.0 - use of IContributionManagerOverrides to override the menu text. But the API is marked as deprecated for 3.1 so I didn't want to use it. The patch for workbench.ide contains a class QuickMenuAccess which JDT/UI duplicates. So Platfrom decides to make the class API, please let me know so that I can remove the duplicate.
Created attachment 11010 [details] Zip file containing the two patches
Here is a test scenario for the attached patch. 1) switch to the Java perspective and press Alt+Shift+W in any view or editor and verify that a context menu with the same contents as in Navigate>Show In shows up. 2) open the Navigate menu and verify that the assigned key binding Alt+Shift+W shows up in the menu for Show In. 3) in any view or editor press Alt+Shift+N and verify that a context menu with the same contents as File>New shows up. 4) open the File menu and verify that Alt+Shift+N is shown as the key binding for the New submenu. 5) open the context menu in the package explorer and verify that Alt+Shift+N is shown as the assigned key binding for the New submenu.
applied patch verified, need to review with NE before committing
doug, please submit this in the next build
this is not currently going into RC1, will mark for RC2
Erich, You might want to look into HEAD at the way the patch was applied as there were some leaks that were fixed in the version we committed. If you have a QuickMenuAction elsewhere it might be useful to have a look
thanks for the info - filed bug# 64855 on the issue
put into todays 8pm build
verified on Build id: 200406041200