Project: Eclipse_Platform_UI
Bug 208626 [KeyBindings] Mnemonic gets hidden if there is existing Alt key binding
Reported: 2007-11-02 18:22:25 | Status: verified fixed

Build ID: M20070212-1330 Steps To Reproduce: 1. Create a plugin for eclipse that includes a key binding for "M1+S" (ie. Alt+S) where S is any letter that is used as a mnemonic in one of the top level menus. Since eclipse uses "S" as the mnemonic for Help > &Software Updates, "S" is sufficient. 2. Launch the plugin as part of Eclipse IDE 3. Press Alt+H to bring down the Help menu (to go along with our example in #1) BUG: Notice "Software Updates" is missing its mnemonic. More information: The code after "if (callback.isAcceleratorInUse(SWT.ALT | character))" inside Eclipse's MenuManager.java removes the mnemonic, but it seems like Eclipse should be checking "isAcceleratorInUse" only for top level menumanagers like File,Edit,...,Help, etc. : /* (non-Javadoc) * @see org.eclipse.jface.action.IContributionItem#update(java.lang.String) */ public void update(String property) { IContributionItem items[] = getItems(); for (int i = 0; i < items.length; i++) { items[i].update(property); } if (menu != null && !menu.isDisposed() && menu.getParentItem() != null && IAction.TEXT.equals(property)) { String text = getOverrides().getText(this); if (text == null) { text = getMenuText(); } if (text != null) { ExternalActionManager.ICallback callback = ExternalActionManager .getInstance().getCallback(); if (callback != null) { int index = text.indexOf('&'); if (index >= 0 && index < text.length() - 1) { char character = Character.toUpperCase(text .charAt(index + 1)); if (callback.isAcceleratorInUse(SWT.ALT | character)) { if (index == 0) { text = text.substring(1); } else { text = text.substring(0, index) + text.substring(index + 1); } } } } menu.getParentItem().setText(text); } } }

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java