1 11 package org.eclipse.jface.fieldassist; 12 13 import org.eclipse.swt.widgets.Control; 14 15 25 public class AutoCompleteField { 26 27 private SimpleContentProposalProvider proposalProvider; 28 private ContentProposalAdapter adapter; 29 30 44 public AutoCompleteField(Control control, 45 IControlContentAdapter controlContentAdapter, String [] proposals) { 46 proposalProvider = new SimpleContentProposalProvider(proposals); 47 proposalProvider.setFiltering(true); 48 adapter = new ContentProposalAdapter(control, controlContentAdapter, 49 proposalProvider, null, null); 50 adapter.setPropagateKeys(true); 51 adapter 52 .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); 53 } 54 55 61 public void setProposals(String [] proposals) { 62 proposalProvider.setProposals(proposals); 63 } 64 } 65 | Popular Tags |