4

次のように JFace ListSelectionDialog を作成します。

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();

ダイアログは正常に表示されます。

ただし、すべてのチェックボックスを選択したいと思います。それ、どうやったら出来るの?

4

2 に答える 2

7
List elementsToSelect = ...
dialog.setInitialElementSelections(elementsToSelect);
于 2009-06-25T18:07:26.277 に答える
0

ListSelectionDialog をサブクラス化し、このメソッドを追加できます。

public void selectAll() {
    getViewer().setAllChecked(true);
}
于 2015-05-28T08:09:01.070 に答える