Krishnaveni
Krishnaveni

Reputation: 809

select all the entries in a checkedTreeselectionDialog

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

Answers (2)

DrKaoliN
DrKaoliN

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

tkotisis
tkotisis

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

Related Questions