/* Auto-Activate on Key-Down */
KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);
/* Create Content Proposal Adapter */
SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]) {
@Override
public IContentProposal[] getProposals(String contents, int position) {
if (Display.getCurrent() != null && !control.isVisible())
return new IContentProposal[0];
return super.getProposals(contents, position);
}
};
proposalProvider.setFiltering(true);
final ContentProposalAdapter adapter = new ContentProposalAdapter(control, contentAdapter, proposalProvider, activationKey, null);
adapter.setPropagateKeys(true);
adapter.setAutoActivationDelay(1500);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);