Bug 201432 - [Dialogs] CheckedTreeSelectionDialog'ssetInitialSelections(..) not working on reopened dialog
Summary: [Dialogs] CheckedTreeSelectionDialog'ssetInitialSelections(..) not working on...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-28 11:13 EDT by Raheel Ashraf CLA
Modified: 2019-09-06 16:07 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raheel Ashraf CLA 2007-08-28 11:13:29 EDT
Build ID: Version: 3.2.2/M20070212-1330

Steps To Reproduce:
1. Create a instance of CheckedTreeSelectionDialog
2. set container model to true
3. open the dialog
4. select only one of the lead node
5. close the dialog
6. fetch the results
7. call setInitialSelections and pass in the value from previous step
8. open the dialog open
9. Notice that all of the lead nodes are 

------------
here is the sample code:

CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(...);
dialog.setInput(..);
dialog.setBlockOnOpen(true);
dialog.setContainerMode(true);

dialog.open();
if(dialog.getReturnCode() == IStatus.OK) {
	Object[] result = dialog.getResult();
	dialog.setInitialSelections(result);
	dialog.open();
}


More information:
Comment 1 Susan McCourt CLA 2007-09-24 16:19:26 EDT
The intention of setInitialSelections is to set the initial selections when the dialog is created.  It is not something that can be set dynamically after the dialog is created.  The way to achieve what you want is to create a new dialog and set the initial selections to the result of the previous dialog.

Redefining the API to work across multiple dialog opens would be considered an enhancement, and is not likely to happen since there is an easy workaround (recreate the dialog).
Comment 2 Raheel Ashraf CLA 2007-09-24 16:38:21 EDT
Maybe this wasn't a good example test case. Consider this use case:
I open the dialog, I select the leaf node L, I close the dialog. I open the dialog. Now what if I want to show L selected this second time when the dialog is open. With current implementation, it will not work even if I create a new dialog the second time..This is because the getResult() will also include L's parent and since setContainedMode is set to true, this will not work.
Comment 3 Susan McCourt CLA 2009-07-09 17:37:31 EDT
as per 2009 triage guidelines
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:07:20 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.