문제

다음과 같이 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();

대화 상자가 잘 나타납니다.

그러나 모든 확인란을 선택하고 싶습니다. 어떻게해야하나요?

도움이 되었습니까?

해결책

List elementsToSelect = ...
dialog.setInitialElementSelections(elementsToSelect);

다른 팁

ListSelectionDialog를 서브 클래스 하고이 방법을 추가 할 수 있습니다.

public void selectAll() {
    getViewer().setAllChecked(true);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top