Bug 157808 - [KeyBindings] JFace library has two independent collections to get an accelerator text for a Menu contribution item
Summary: [KeyBindings] JFace library has two independent collections to get an acceler...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2006-09-19 09:36 EDT by Yevgeni CLA
Modified: 2019-09-06 15:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yevgeni CLA 2006-09-19 09:36:12 EDT
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);
                    }


.............................................
}
Comment 1 Boris Bokowski CLA 2006-09-19 12:15:05 EDT
So the bug is that the menu item reads
"Align Left Ctrl+Alt+Arrow Left" but should be
"Align Left Ctrl+Alt+Left"?
Comment 2 Paul Webster CLA 2006-10-03 14:13:38 EDT
I won't be fixing bugs until 3.3M4 (which is in six weeks).

PW
Comment 3 Paul Webster CLA 2006-10-03 14:20:35 EDT
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
Comment 4 Tod Creasey CLA 2006-10-03 14:31:41 EDT
No identifier should be localized - only human readable labels.
Comment 5 Eclipse Webmaster CLA 2019-09-06 15:33:14 EDT
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.
Comment 6 Eclipse Webmaster CLA 2019-09-06 15:35:38 EDT
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.