选中checkedTreeselectionDialog中的所有条目 [英] select all the entries in a checkedTreeselectionDialog

查看:294
本文介绍了选中checkedTreeselectionDialog中的所有条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用org.eclipse.ui.dialogs.CheckedTreeSelectionDialog来显示值列表。我想默认选择(检查)所有的值。您可以让我知道如何做到这一点。

I am using org.eclipse.ui.dialogs.CheckedTreeSelectionDialog, to display a list of values. I want to select(check) all the values by default. Can you please let me know how this can be done.

推荐答案

您可以设置最初检查的节点(在对话框创建时) ,通过使用 setInitialElementSelections 方法。

You can set which nodes are checked initially (on dialog creation), by using the setInitialElementSelections method.

CheckedTreeSelectionDialog dlg = new CheckedTreeSelectionDialog(shell, 
    new cLabelProvider(), 
    new cContentProvider());
dlg.setInput(model);
dlg.setInitialElementSelections(model.getAllElements());

这篇关于选中checkedTreeselectionDialog中的所有条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆