Community
Participate
Working Groups
I created dynamically a new workbench menu with some contribution items. One of them has an accelerator value Ctrl+Shift+Arrow_Left: MyAction.setAccelerator(Action.convertAccelerator("Ctrl+Shift+Arrow_Left")); When my menu has been built I saw that the contributed item has a label "Align Left Ctrl+Al+Arrow Left" instead of "Align Left Ctrl+Alt+Left" like the "Back Alt+Left" from Navigate menu. I debugged the JFace library and found that if the an action was created from XML definition that it use the ExternalActionManager class to get accelerator text but if an action was done dynamically whith an accelerator value than it use the convertAccelerator method from Action class (look at snipped code from the ActionContributionItem class): public void update(String propertyName) { ........................................ if (accelerator == 0) { if ((callback != null) && (commandId != null)) { acceleratorText = callback .getAcceleratorText(commandId); } } else { acceleratorText = Action .convertAccelerator(accelerator); } ............................................. }
So the bug is that the menu item reads "Align Left Ctrl+Alt+Arrow Left" but should be "Align Left Ctrl+Alt+Left"?
I won't be fixing bugs until 3.3M4 (which is in six weeks). PW
This problem seems to be related to the JFace resources calls and LegacyActionTools key string map, keyStrings.put(new Integer(SWT.ARROW_LEFT), JFaceResources .getString("Arrow_Left")); //$NON-NLS-1$ and Arrow_Left = Arrow Left Tod, Should the "keycodes" even be localized? PW
No identifier should be localized - only human readable labels.
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.