Reputation: 809
I am using org.eclipse.ui.dialogs.CheckedTreeSelectionDialog, to display a list of values. I want to select(check) all the values by default. Can you please let me know how this can be done.
Upvotes: 0
Views: 178
Reputation: 1402
Also, make sure that you do your
dlg.setInitialElementSelections(model.getAllElements());
before you open your dialog:
dlg.open();
because otherwise it won't work.
Upvotes: 0
Reputation: 3552
You can set which nodes are checked initially (on dialog creation), by using the setInitialElementSelections method.
CheckedTreeSelectionDialog dlg = new CheckedTreeSelectionDialog(shell,
new cLabelProvider(),
new cContentProvider());
dlg.setInput(model);
dlg.setInitialElementSelections(model.getAllElements());
Upvotes: 2