« Return to Thread: reading table selected items after filter changed - SWT

reading table selected items after filter changed - SWT

by Matt P :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have a FilterList feeding an EventTableViewer for a SWT table.  The filterlist is connected to a TextWidgetMatcherEditor and a Text widget.   Everything works as normal.

I also have a detail area on my UI, so that when there is an item selected in the table, the details of that item is shown in the detail area.  

The problem is when there is an item already selected in the table, and then I type stuff into the filter text widget, the selected item possibly will disappear from the table.  At this point I would like to then clear the detail area since the corresponding selected item is no longer visible in the table.

So I thought I would add a listener to the fitlerList.  

                filterList.addListEventListener( new ListEventListener<Employee>() {
                        public void listChanged(ListEvent<Employee> event) {
                                //what do I do here to determine if the selected item is now not in this list?
                        }
                });


However I am getting thoroughly confused on how the listChanged() method  and the ListEvents are supposed to work.  I can't find much in the docs or searching to solve this...
Is there a better way of doing this?

Thanks

 « Return to Thread: reading table selected items after filter changed - SWT