是否有适用于 SWT/JFace 的合理自动完成小部件?
我希望我的应用程序能够自动完成,但我需要注意一些特殊情况。
我的字段的支持是一个对象列表,其中可能有多个字段(比如说 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试查看 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 ownContentProposalAdapter
, add aIContentProposalListener
, and attach it to the modify event of aText
widget, for instance.我使用 SWT 插件来自动完成文本字段。它们并不完美,但对我有用
I used SWT Add-ons for auto-complete text fields. They're not perfect, but worked for me