Community
Participate
Working Groups
I20070205-0009 The FilteredItemsSelectionDialog should always select the first item of the new result list on update. The item should be selected as soon as the first result (from history or from the content provider) is available and shown. Steps: - with a JDK 5.0, open Open Type dialog - write "Read" - select "Reader - java.io" - Shift+Tab, press "e" to turn the filter into "Reade" => Expected: first item should be selected => Was: a completely unrelated type is selected (ReaderThreadImpl in my case). It looks like the selection stays at the table element with the same index. This is almost never what the user expects.
Created attachment 59555 [details] Patch fixes this bug
Patch updated and released for build >20070222
Fix is not good: list.getTable().deselectAll(); list.getTable().setSelection(0); - deselectAll() is redundant since setSelection(..) first clears selection (please read Javadoc) - Table#setSelection(..) does not send out JFace selection events, which is why the status line is not updated when the filter changes. You need to select domain elements via TableViewer#setSelection(..) to get the notification right.
Created attachment 59669 [details] Changes depend on Markus suggestion Right Markus, i changed it.
Notes to patch from comment 4: - extracting list.getElementAt(0) into a local var would save a call - getElementAt(int) is marked as "This method is internal to the framework." - TypeInfoViewer did: fTable.setSelection(0); fTable.notifyListeners(SWT.Selection, new Event());
Created attachment 59866 [details] Patch is an answered to Markus suggestion.
Patch released for build >20060301