gpt4 book ai didi

java - JFace问题: How do I select all items in a ListSelectionDialog?

转载 作者:搜寻专家 更新时间:2023-11-01 01:58:57 24 4
gpt4 key购买 nike

我创建了一个 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);

关于java - JFace问题: How do I select all items in a ListSelectionDialog?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1045362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com