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

Bug 403206

Summary: [MenuItem] Support Accelerator Text
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jsetya, tbuschto
Version: 2.1   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ralf Sternberg CLA 2013-03-13 11:02:14 EDT
In SWT, MenuItems support the display of accelerators in the text. Since MenuItem#setAccelerator is now supported (bug 303034), we should also add support for accelerator text.

From the JavaDoc of MenuItem#setText:

"Accelerator text is indicated by the '\t' character. On platforms that support accelerator text, the text that follows the '\t' character is displayed to the user, typically indicating the key stroke that will cause the item to become selected. [...]"
Comment 1 Tim Buschtoens CLA 2013-03-20 10:55:46 EDT
Fixed in commit d5028580dbbc09a1612137ddca143f31a7bf72f0.

The tab is rendered as four white spaces and the text is aligned right
like in windows. The MenmonicTab in the controls demo was slightly
modified to contain a accelerator example.
Comment 2 Setya Nugdjaja CLA 2015-02-05 21:42:15 EST
Hi Tim,

Is accelerator in IAction supported ? Since I'm unable to make it work using IAction.setAccelerator.

Thanks & Regards,
Setya
Comment 3 Ivan Furnadjiev CLA 2015-02-06 07:05:56 EST
Setya, if your code works in RCP please file a bugzilla with complete self-running snippet (project/entry point) in order to reproduce the issue.