Community
Participate
Working Groups
PRODUCT VERSION: SWT 2.003 Photon DESCRIPTION: DLW (10/11/2001 5:05:03 PM): When an item is removed from a Combo widget, and an item is already selected farther down in the list, the selection index should be adjusted to correspond with the item that moved up in the list. In the following example, the selectionIndex should be 1 after item 0 is removed, since the previously selected item moved up from location 2 to location 1 in the list. --- cut here ---------- import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; //------------------------------------------------------------------- // //------------------------------------------------------------------- public class PR_1GLGA41 { private Display display; private Shell shell; private Combo c; //------------------------------------------------------------------- // //------------------------------------------------------------------- static public void main(String[] args) { new PR_1GLGA41().runMain(args); } //------------------------------------------------------------------- // //------------------------------------------------------------------- private void runMain(String[] args) { display = new Display(); shell = new Shell(display); shell.setText(getClass().getName()); shell.setBounds(0,0,200,200); shell.setLayout(new GridLayout()); c = new Combo(shell,SWT.DROP_DOWN | SWT.READ_ONLY); c.add("Item 1"); c.add("Item 2"); c.add("Item 3"); shell.open(); c.select(2); c.remove(0); System.out.println(c.getSelectionIndex()); // should be 1 while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } } ---- cut here ---------- NOTES: =======================================
PRODUCT VERSION: SWT 2.003 Photon
What's the status on this?
Not sure why this was not fixed yet. Anyway, fixed >20020514.
Thanks Silenio!