Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 214491

Summary: [Dialogs] FilteredItemsSelectionDialog should respect setInitialSelections()
Product: [Eclipse Project] Platform Reporter: Eric Rizzo <eclipse-bugs>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emmanuel.chebbi, hannes, karsten.thoms
Version: 3.4   
Target Milestone: 4.14 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/150637
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3e49f9ea3130e7ba80887b4638db2bfe6eb18360
Whiteboard:

Description Eric Rizzo CLA 2008-01-07 10:34:21 EST
Using org.eclipse.ui.dialogs.FilteredItemsSelectionDialog with a requirement to pre-select items in the list. I see that I can call setInitialSelections() inherited from org.eclipse.ui.dialogs.SelectionDialog but it appears that is not used by FilteredItemsSelectionDialog.
Even worse, because the TableViewer that FilteredItemsSelectionDialog uses is private and has no protected exposure, there doesn't appear to be any way for a client to set an initial selection even through subclassing.
Comment 1 Susan McCourt CLA 2008-01-16 14:45:00 EST
I believe this goes to Tod as an IDE/Dialog bug.
Comment 2 Susan McCourt CLA 2009-07-09 18:21:57 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 3 Hannes Erven CLA 2009-08-19 19:43:22 EDT
As Francis Upton states on http://www.eclipsezone.com/eclipse/forums/t105252.html , there is an ugly workaround: use setInitialPattern() and set the pattern to the text of the element-to-select.

This of course won't work with more than one item to select;
and even with a single initial selection element you need to make sure that the sorting of the items is so that it always selects the right element, e.g. with elements
 foo
 foobar
 foofoobar
the initial selection of "foo" only works when the elements are sorted by normal string comparison.

Is there a chance this is going to be fixed/improved?
At least some documentation (eg. "throw new UnsupportedOperationException()" for those unsupported operations) would be nice. Thanks!
Comment 4 Susan McCourt CLA 2009-08-19 21:20:53 EDT
(In reply to comment #3)
> 
> Is there a chance this is going to be fixed/improved?
> At least some documentation (eg. "throw new UnsupportedOperationException()"
> for those unsupported operations) would be nice. Thanks!
> 

If you submit a patch (with a test case) I will give it a 3.6 milestone to review it.  Otherwise it's unlikely to happen.
Comment 5 Eclipse Genie CLA 2019-04-29 02:23:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Emmanuel Chebbi CLA 2019-10-04 14:39:54 EDT
I can confirm that the bug is not fixed.

I implemented the feature and will submit a patch as soon as I have implemented a few tests.
Comment 7 Karsten Thoms CLA 2019-10-04 15:13:04 EDT
(In reply to Emmanuel Chebbi from comment #6)
> I can confirm that the bug is not fixed.
Thanks for confirming. It is always hard to tell for old bugs if they are still relevant.

> 
> I implemented the feature and will submit a patch as soon as I have
> implemented a few tests.

That'll be awesome! Please raise your voice when you need guidance for the contribution process.
Comment 8 Eclipse Genie CLA 2019-10-05 14:34:45 EDT
New Gerrit change created: https://git.eclipse.org/r/150637
Comment 9 Emmanuel Chebbi CLA 2019-10-05 14:50:46 EDT
> Please raise your voice when you need guidance for the contribution process.

Thank you very much! I just submitted a new Gerrit change but since it's my first time I am not quite confident about what comes next. Review comments are made directly on Gerrit, right?
Comment 10 Karsten Thoms CLA 2019-10-05 16:49:23 EDT
Yes, feedback on a specific change is done on Gerrit. Here the issue itself and how to reproduce it is discussed.
Comment 12 Karsten Thoms CLA 2019-10-14 06:48:23 EDT
Thanks Emmanuel for your conntribution!