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

Bug 294193

Summary: [Combo] swallows whitespaces
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Muskalla CLA 2009-11-04 08:28:31 EST
Whitespaces in combo items are not escaped and thus ignored on the client side.

package asd;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Foo {

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));

		Combo combo = new Combo(shell, SWT.DROP_DOWN);
		combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
		combo.setItems(new String[] {"foo", "   foo", "         foo"});
		

		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}

This works as expected on SWT (GTK).
Comment 1 Ivan Furnadjiev CLA 2009-11-05 02:16:44 EST
Fixed in CVS HEAD.