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

Bug 395426

Summary: [JFace] StatusDialog should escape ampersand in status message
Product: [Eclipse Project] Platform Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, pwebster, ruediger.herrmann
Version: 3.8Keywords: helpwanted
Target Milestone: 4.3 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed solution none

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.