Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312960 - org.eclipse.swt.custom.PopupList - should be able to set the SWT.H_SCROLL style on the List widget
Summary: org.eclipse.swt.custom.PopupList - should be able to set the SWT.H_SCROLL sty...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Lakshmi P Shanmugam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 14:42 EDT by Nick Chiu CLA
Modified: 2010-09-14 02:26 EDT (History)
3 users (show)

See Also:


Attachments
patch-1 (1.02 KB, patch)
2010-08-13 06:02 EDT, Lakshmi P Shanmugam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Chiu CLA 2010-05-14 14:42:05 EDT
Build Identifier: M20080911-1700

When using org.eclipse.swt.custom.PopupList, their is no method or argument in the constructor to set the style of the List widget. More importantly I can't set the SWT.H_SCROLL style on the List widget, it only has SWT.V_SCROLL.

This bug is blocking a core feature in our product where the customer cannot see the list of values if the values are very long. Even the tooltip doesn't wrap.

Reproducible: Always

Steps to Reproduce:
1. Look in the constructor of org.eclipse.swt.custom.PopupList
2. Notice when it instantiates the List widget it hardcodes the style with no SWT.H_SCROLL
Comment 1 Felipe Heidrich CLA 2010-05-14 15:19:42 EDT
After 3.6
New API are not permitted at this time. Sorry.
Comment 2 Grant Gayed CLA 2010-05-27 16:23:50 EDT
Lakshmi, talk to SSQ before doing anything here since API could be involved.
Comment 3 Lakshmi P Shanmugam CLA 2010-08-13 06:02:55 EDT
Created attachment 176534 [details]
patch-1

When the user sets SWT.H_SCROLL in the style of the PopupList, the List will be created with SWT.H_SCROLL.
Comment 4 Lakshmi P Shanmugam CLA 2010-08-13 06:05:01 EDT
Test case:
public class PopupListExample1 {
	public static void main(String[] args) {
		Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setLayout(new RowLayout());
		Button button = new Button(shell, SWT.PUSH);
		button.setText("show popup");
		button.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				PopupList list = new PopupList(shell, SWT.H_SCROLL);
				list.setItems(new String[] {"veryveryveryveryveryveryloooooooooongtext", "jojo", "lk", "k", "l", "op", "opop", "text"});
				list.open(shell.getBounds());
			}
		});
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 5 Lakshmi P Shanmugam CLA 2010-08-13 11:00:24 EDT
SSQ, can you please review?
Comment 6 Silenio Quarti CLA 2010-08-13 13:42:01 EDT
Looks good.
Comment 7 Lakshmi P Shanmugam CLA 2010-08-16 03:50:17 EDT
Fixed in HEAD > 20100816.