views:

333

answers:

1

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?

+3  A: 
List elementsToSelect = ...
dialog.setInitialElementSelections(elementsToSelect);
James Van Huis
Just figured it out myself too :P Thanks.
Nocturne