Jface 질문 : ListSelectionDialog에서 모든 항목을 어떻게 선택합니까?
-
20-08-2019 - |
문제
다음과 같이 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);
}
제휴하지 않습니다 StackOverflow