是否有适用于 SWT/JFace 的合理自动完成小部件?

发布于 2024-10-14 11:31:24 字数 186 浏览 6 评论 0原文

我希望我的应用程序能够自动完成,但我需要注意一些特殊情况。

我的字段的支持是一个对象列表,其中可能有多个字段(比如说 id 和 name)。自动完成功能应该适用于其中任何一个。完成后,该字段应包含 id,而不是名称,并且应该可以输入不同的内容,即不属于给定列表的对象的 id。

有人为 SWT/JFace 构建过类似的东西吗?

I wnat to have autocompletion for my application, but there are some pecularities I need to take care of.

The backing of my field is a list of objects, which may have several fields (lets say id and name). Autocompletion should work on on either one. After completion the field should contain the id, not the name, and it should be possible to input something different, namely an id which does not belong to an object of the given list.

Has somebody built something like that for SWT/JFace?

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

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

发布评论

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

评论(2

一口甜 2024-10-21 11:31:24

尝试查看 org.eclipse.jface.fieldassist 包,它可能会满足您的要求。更具体地说,例如,您可以编写自己的 ContentProposalAdapter,添加 IContentProposalListener,并将其附加到 Text 小部件的修改事件。

Try looking at the org.eclipse.jface.fieldassist package, it may do what you want. More specifically, you can write your own ContentProposalAdapter, add a IContentProposalListener, and attach it to the modify event of a Text widget, for instance.

游魂 2024-10-21 11:31:24

我使用 SWT 插件来自动完成文本字段。它们并不完美,但对我有用

I used SWT Add-ons for auto-complete text fields. They're not perfect, but worked for me

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