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

Bug 348365

Summary: [Forms] form text with an ampersand is cut off
Product: [RT] RAP Reporter: Flavio Donze <flavio.donze>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 1.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Flavio Donze CLA 2011-06-06 05:06:41 EDT
Build Identifier: 1.4.0.20110601-1304

Here is an example snipped:
IManagedForm managedForm = new ManagedForm(parent);
ScrolledForm scrolledForm = managedForm.getForm();
Form form = scrolledForm.getForm();
form.setText("TEST1 & TEST2");

Only "TEST1" is displayed, the rest is cut off. If I replace the & with something like #, "TEST1 # TEST2" is displayed.

Reproducible: Always
Comment 1 Ivan Furnadjiev CLA 2011-06-06 06:44:02 EDT
Flavio, if you want to visualize the '&' character you should use double '&' in the string like:
form.setText( "TEST1 && TEST2" );
Read Label#setText JavaDoc for more details. Nevertheless, text cut off (wrapping) is a bug. The space for the label (calculated by Label#computeSize) is smaller and the text wraps.
Comment 2 Flavio Donze CLA 2011-06-06 07:12:09 EDT
Ivan thanks for pointing that out! I didn't notice that in the RCP application it didn't get displayed as well.
Comment 3 Ivan Furnadjiev CLA 2012-03-23 08:00:52 EDT
I found that actually this bug is a duplicate of bug 371360. A single '&' character is replaced with a space, resulting in multiple spaces between words.

*** This bug has been marked as a duplicate of bug 371360 ***