Community
Participate
Working Groups
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
After 3.6 New API are not permitted at this time. Sorry.
Lakshmi, talk to SSQ before doing anything here since API could be involved.
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.
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(); } }
SSQ, can you please review?
Looks good.
Fixed in HEAD > 20100816.