寻找在SWT / JFace的,它支持自动完成一个组合(浏览器) [英] Looking for a Combo(Viewer) in SWT/JFace which supports autocomplete

查看:284
本文介绍了寻找在SWT / JFace的,它支持自动完成一个组合(浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在SWT / JFace的,它支持自动完成/提前输入一个组合(浏览器),即用户可以输入几个字符,并在下拉列表中应显示所有匹配的元素。

I'm looking for a Combo(Viewer) in SWT/JFace which supports autocomplete / type-ahead, i.e. the user can enter a couple of characters and the drop down list should show all matching elements.

推荐答案

您还可以检查出 org.eclipse.jface.fieldassist.AutoCompleteField 类。这不是一个组合,只是一个文本字段,但它增加了自动完成功能,就好像它是一个组合非常容易。你可以做这样简单的事情,因为这:

You can also check out the org.eclipse.jface.fieldassist.AutoCompleteField class. It's not a combo, just a text field, but it adds auto complete functionality as if it were a combo very easily. You can do something as simple as this:

Text textField = new Text(parentComposite, SWT.BORDER);
new AutoCompleteField(textField, new TextContentAdapter(), new String[] 
    {"autocomplete option 1", "autocomplete option 2"});

这篇关于寻找在SWT / JFace的,它支持自动完成一个组合(浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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