Mauli
Mauli

Reputation: 17203

Is there a sensible autocompletion widget available for 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?

Upvotes: 3

Views: 1199

Answers (2)

drstupid
drstupid

Reputation: 433

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

Upvotes: 3

Jean-Philippe Pellet
Jean-Philippe Pellet

Reputation: 60006

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.

Upvotes: 3

Related Questions