Bug 395426 - [JFace] StatusDialog should escape ampersand in status message
Summary: [JFace] StatusDialog should escape ampersand in status message
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-11-29 17:49 EST by Rüdiger Herrmann CLA
Modified: 2012-12-11 06:38 EST (History)
3 users (show)

See Also:


Attachments
Proposed solution (5.36 KB, patch)
2012-11-30 18:19 EST, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2012-11-29 17:49:14 EST
Ampersand characters in status messages cause the succeeding character to be shown as a mnemonic.
For example
  IStatus status= new Status( IStatus.ERROR, "plug.in", "peter&mary" )
  statusDialog.updateStatus( status );
shows this status message
 peter_m_ary

I suggest to escape the ampersand character in status messages.
Comment 1 Paul Webster CLA 2012-11-30 08:12:17 EST
There's org.eclipse.jface.action.LegacyActionTools.escapeMnemonics(String) used by org.eclipse.jface.action.StatusLineContributionItem

PW
Comment 2 Rüdiger Herrmann CLA 2012-11-30 18:19:11 EST
Created attachment 224182 [details]
Proposed solution

These changes escape ampersand characters as suggested in comment #1.

The accompanying test case relies on the fact that there exists a single CLabel within the dialog which displays the status message.
I'm happy to change that if there is another way to obtain the message when shown.
Comment 4 Dani Megert CLA 2012-12-11 06:38:56 EST
Verified in I20121210-2000.