Eclipse RCP – Auto-complete Text and Combo widgets
Today I will describe a simple way to add auto-completion to you Eclipse RCP/SWT based application using some resources I’ve found browsing the web. To not reinvent the wheel, I have found a project on sourceforge which does just that, and which does the job well enough.
First of all go to the sourceforge website and download the sources, you don’t have to download a full eclipse plugin project, just download the packages we need from here by clicking ‘Download GNU Tarball’.
Copy and paste the whole downloaded folder into your ‘src’ directory visible in eclipse ‘package explorer’.
You can use this classes in the following way:
new AutocompleteTextInput(fieldTxt, options);
Where ‘fieldTxt’ is your textfield object (already created) and ‘options’ is a String array (String[]) with possible options to display.
Thanks to derekhunter4 for this project. You can find more info on sourceforge: swtaddons