Bug 4126 - SelectionDialog.setInitialSelection broken for all JDT dialogs (1GIRGYV)
Summary: SelectionDialog.setInitialSelection broken for all JDT dialogs (1GIRGYV)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1580
  Show dependency tree
 
Reported: 2001-10-10 23:06 EDT by Dirk Baeumer CLA
Modified: 2001-12-17 04:52 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2001-10-10 23:06:28 EDT
The method SelectionDialog.setInitialSeleciton doesn't work as aspected in all JDT subclasses. The elements passed to this method should
be of the same type as the elements passed to setElements. We should never use Strings because they depend on the rendering. 

Passing Strings currently only works for special subclasses when using special open methods which aren't public.


NOTES:
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:13:33 EDT
moved to 'active'
Comment 2 DJ Houghton CLA 2001-10-29 17:33:06 EST
PRODUCT VERSION:
130

Comment 3 Erich Gamma CLA 2001-11-11 16:28:37 EST
The selection dialogs got reworked after the code review and I think this 
problem got addressed. Claude pls confirm and dispose PR if possible.
Comment 4 Claude Knaus CLA 2001-11-13 11:35:05 EST
yes, this got addressed. setInitialSelection() takes elements and not strings.
Comment 5 Joe Szurszewski CLA 2001-11-20 14:26:13 EST
This bug claims to be fixed, but it isn't.  The 'setInitialSelections()" method 
DOES take an array of Objects as an argument, however, it doesn't seem to do 
anything with them.  When I try to pop up a selection dialog populated with 
package fragments, I call 'setInitialSelections()' passing in an array 
containing a single IPackageFragment.  When I debug this call, it seems the 
failure happens when setSelection() is called on ElementListSelectionDialog.  
This method calls fFilteredList.setSelection().  This method does nothing when 
an array of one element is passed in because fFoldedCount is zero.  Thus, the 
selection dialog pops up with nothing in the list, and an 'A' in the filter.
Comment 6 Claude Knaus CLA 2001-11-21 04:28:07 EST
setInitialSelections() can only select elements which are 'visible', specified 
by the filter. I assume that you haven't called setFilter() prior to 
setInitialSelections(), therefore you get 'A' as a default filter.
If your package fragment does not start with 'A', you'll end up with an empty 
list and you can't select anything.

If my assumption is wrong, please post the few lines the way you use the dialog.
Comment 7 Claude Knaus CLA 2001-12-17 04:52:27 EST
since there's no answer, I assume it's fine to be closed.