| Summary: | reducing item count can send Selection event | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Grant Gayed <grant_gayed> |
| Component: | SWT | Assignee: | Scott Kovatch <skovatch> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.6 | ||
| Target Milestone: | 3.6.1 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Good catch. List has a similar problem, but only when you remove the last item from the list. Patch is in bug 317054. Fixed in HEAD and R3_6 branch > 20100628. |
- happens only on Table, not on Tree - run the snippet below, wait for a few seconds, and you'll see that a Selection event is received when the Table's item count is set to 4 -> on win32 and gtk this Selection event does not happen (haven't tried Carbon) - it may be another case of ignoreSelect = true/false needed around noteNumberOfRowsChanged() invocation public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(200, 200, 200, 200); shell.setLayout(new FillLayout()); final Table table = new Table(shell, SWT.MULTI); for (int i = 0; i < 9; i++) { new TableItem(table, SWT.NONE).setText("hi " + i); } shell.open(); table.selectAll(); table.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { System.out.println("selection"); } }); display.timerExec(3333, new Runnable() { public void run() { table.setItemCount(4); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }