Reputation: 47101
I create a JFace ListSelectionDialog as follows.
final ListSelectionDialog dialog = new ListSelectionDialog(
PlatformUI.getWorkbench().getDisplay().getActiveShell(),
List<SomeClass>,
new ArrayContentProvider(),
new LabelProvider(),
""); //$NON-NLS-1$
dialog.setTitle("Dialog Title"); //$NON-NLS-1$
dialog.setMessage("SomeMessage"); //$NON-NLS-1$
dialog.open();
and the dialog shows up fine.
However, I'd like all the checkboxes to be selected. How do I do that?
Upvotes: 4
Views: 1331
Reputation: 301
You can subclass the ListSelectionDialog and add this method:
public void selectAll() {
getViewer().setAllChecked(true);
}
Upvotes: 0
Reputation: 5561
List elementsToSelect = ...
dialog.setInitialElementSelections(elementsToSelect);
Upvotes: 7