Bug 62252 - [Workbench] Provide short cut menu for Navigate>Show in>
Summary: [Workbench] Provide short cut menu for Navigate>Show in>
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Michael Van Meekeren CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
: 34257 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-14 08:37 EDT by Erich Gamma CLA
Modified: 2004-06-07 08:43 EDT (History)
4 users (show)

See Also:


Attachments
Zip file containing the two patches (4.95 KB, application/octet-stream)
2004-05-24 10:34 EDT, Dirk Baeumer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2004-05-14 08:37:38 EDT
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
Comment 1 Michael Van Meekeren CLA 2004-05-14 12:21:20 EDT
any suggested key combination?
Comment 2 Erich Gamma CLA 2004-05-14 12:49:30 EDT
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...
Comment 3 Nick Edgar CLA 2004-05-14 13:07:41 EDT
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.
Comment 4 Nick Edgar CLA 2004-05-14 13:32:27 EDT
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.
Comment 5 Erich Gamma CLA 2004-05-14 17:23:35 EDT
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.
Comment 6 Erich Gamma CLA 2004-05-16 15:59:55 EDT
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.
Comment 7 Erich Gamma CLA 2004-05-21 17:03:34 EDT
*** Bug 34257 has been marked as a duplicate of this bug. ***
Comment 8 Erich Gamma CLA 2004-05-21 17:04:59 EDT
(btw, Adam filed the original bug for this - so the "polish" key word is 
really justified <g>)
Comment 9 Dirk Baeumer CLA 2004-05-24 10:31:59 EDT
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.

Comment 10 Dirk Baeumer CLA 2004-05-24 10:34:00 EDT
Created attachment 11010 [details]
Zip file containing the two patches
Comment 11 Erich Gamma CLA 2004-05-27 19:02:47 EDT
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.
Comment 12 Michael Van Meekeren CLA 2004-05-28 11:01:52 EDT
applied patch verified, need to review with NE before committing
Comment 13 Michael Van Meekeren CLA 2004-05-28 13:25:36 EDT
doug, please submit this in the next build
Comment 14 Michael Van Meekeren CLA 2004-05-28 16:46:59 EDT
this is not currently going into RC1, will mark for RC2
Comment 15 Michael Van Meekeren CLA 2004-05-28 16:54:10 EDT
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
Comment 16 Erich Gamma CLA 2004-05-31 18:37:33 EDT
thanks for the info - filed bug# 64855 on the issue
Comment 17 Michael Van Meekeren CLA 2004-06-02 16:11:39 EDT
put into todays 8pm build
Comment 18 Michael Van Meekeren CLA 2004-06-07 08:43:23 EDT
verified on Build id: 200406041200