Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323158

Summary: [Commands] Accelerator is displayed twice in one menu item
Product: [Eclipse Project] Platform Reporter: Kamil Fejfar <comediant>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED WONTFIX QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Broken edit menu screenshot none

Description Kamil Fejfar CLA 2010-08-19 11:03:42 EDT
Build Identifier: M20100211-1343

This problem happens when a display name of an action includes accelerator separated with @ or \t (e.g. edit actions in czech localization bundle (Workbench_cut=Vyjmout@Ctrl+X))

One problem seems to be in LabelRetargetAction, and its appendAccelerator(String) method. There is probably forgotten to insert delimiter @ or \t. This causes problem in Undo, Redo actions.

Another problem can be in CommandContributionItem (Cut, Copy, Paste actions). It probably does not expect, that name can contain an accelerator.

Reproducible: Always

Steps to Reproduce:
1. Run eclipse with localization bundle where action names include accelerator (e.g. czech localization bundle) 
2. Go to edit menu.
Comment 1 Kamil Fejfar CLA 2010-08-19 11:05:35 EDT
Created attachment 177008 [details]
Broken edit menu screenshot
Comment 2 Paul Webster CLA 2010-11-09 08:31:34 EST
You should not include the accelerator in your action label, and definitely not in a command name.

In an RCP app or IDE app, keybindings need to be used.

PW
Comment 3 Paul Webster CLA 2010-11-09 08:32:48 EST
A potential option ... strip out the accelerator text from the name.  But that would mean you have incorrect information (since the name says one thing, and we would not honour it in the UI).

PW