JFace 问题:禁用 ListSelectionDialog 中的某些条目?

发布于 2024-09-17 06:53:43 字数 201 浏览 6 评论 0原文

我有一个列表选择对话框。例如这样的事情:

现在我想做的是永久选择和禁用一些项目(基本上我想向用户表明这些是“核心”选择的一部分并且不是可选的)。

有办法做到这一点吗?

I have a ListSelectionDialog. Something like this for instance:

Now what I'd like to do is to have some items permanently selected and disabled (Basically I'd like to indicate to the user that these are part of the "core" selections and are not optional).

Is there a way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

再浓的妆也掩不了殇 2024-09-24 06:53:43

不幸的是,该对话框不提供您需要的功能。它使用 JFace CheckboxTableViewer 来显示项目,但它不能很好地支持复选框的“禁用”状态(从 Eclipse 3.5 开始)。此外,该对话框不打算被子类化。

Unfortunately this dialog does not provide the functionality that you need. It uses the JFace CheckboxTableViewer to display the items, which does not support the "disabled" state of the check boxes very well (as of Eclipse 3.5). Furthermore this dialog is not intended to be subclassed.

肩上的翅膀 2024-09-24 06:53:43

该对话框使用的查看器是 CheckboxTableViewer。

您可以尝试添加一个checkstatelistener来取消“核心”选择的取消选择。
您还可以使用 setGrayedElements 方法使它们在视觉上禁用。

我不确定这是否会产生想要的行为。

the viewer used by this dialog is the CheckboxTableViewer.

You can try to add a checkstatelistener to cancel the unselection of the "core" selections.
Also you can use the method setGrayedElements to make them visually disabled.

I am not sure if this will give the wanted behaviour though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文