| Summary: | [widgets] SWT Cocoa, StructuredViewer dispatches selectionChanged on refresh()/setInput() | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Anirudh Sasikumar <anirudhsasikumar> | ||||||||
| Component: | SWT | Assignee: | Scott Kovatch <skovatch> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Silenio Quarti <Silenio_Quarti> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | skovatch | ||||||||
| Version: | 4.0 | Flags: | grant_gayed:
review+
|
||||||||
| Target Milestone: | 3.6.1 | ||||||||||
| Hardware: | Macintosh | ||||||||||
| OS: | Mac OS X | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Anirudh Sasikumar
This has bad side effects in Adobe Flash Builder: loops of selectionChanged/refresh(), unexpected actions occurring when refresh() is called, etc. Can you post a test case that's failing? I'm attaching a modified snippet that I think does what you're describing, but the selectionChanged() doesn't fire when you click the button. Created attachment 171652 [details]
test case
Modified TreeViewer snippet.
Hi Scott, Thank you for that test case. I tried it out: 1. Change TreeViewer to ListViewer and selectionChanged() will fire on Button press. 2. Using a TreeViewer, change v.refresh() to v.setInput() and selectionChanged() will fire. These two cases do not occur on windows/carbon. I'll attach the modified test cases as well. Thanks, Anirudh Sasikumar, Flash Builder Engineering Created attachment 171696 [details]
Scott's test case modified to use a ListViewer (with commented out setInput() call to use when the TreeViewer is used)
Modified test case.
It looks like Tree.removeAll() is triggering a outlineViewSelectionDidChange event when we call reloadData(). I suspect something similar is happening in Table. Looks like we just need an ignoreSelect = true/false pair around reloadData. Created attachment 171880 [details]
Fix for Tree, List, & Table
Ignore selection change events when calling removeAll.
Grant, can you review for 3.6.1? This was the first bug that motivated bug 317054 and bug 317051, so I'm marking it fixed in 3.6.1 and HEAD. |