Community
Participate
Working Groups
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:
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).
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.
as per 2009 triage guidelines
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.