Package org.eclipse.jface.fieldassist
Class SimpleContentProposalProvider
java.lang.Object
org.eclipse.jface.fieldassist.SimpleContentProposalProvider
- All Implemented Interfaces:
IContentProposalProvider
SimpleContentProposalProvider is a class designed to map a static list of
Strings to content proposals.
- Since:
- 3.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleContentProposalProvider(String... proposals) Construct a SimpleContentProposalProvider whose content proposals are always the specified array of Objects. -
Method Summary
Modifier and TypeMethodDescriptiongetProposals(String contents, int position) Return an array of Objects representing the valid content proposals for a field.voidsetFiltering(boolean filterProposals) Set the boolean that controls whether proposals are filtered according to the current field content.voidsetProposals(String... items) Set the Strings to be used as content proposals.
-
Constructor Details
-
SimpleContentProposalProvider
Construct a SimpleContentProposalProvider whose content proposals are always the specified array of Objects.- Parameters:
proposals- the Strings to be returned whenever proposals are requested.
-
-
Method Details
-
getProposals
Return an array of Objects representing the valid content proposals for a field.- Specified by:
getProposalsin interfaceIContentProposalProvider- Parameters:
contents- the current contents of the field (only consulted if filtering is set totrue)position- the current cursor position within the field (ignored)- Returns:
- the array of Objects that represent valid proposals for the field given its current content.
-
setProposals
Set the Strings to be used as content proposals.- Parameters:
items- the Strings to be used as proposals.
-
setFiltering
public void setFiltering(boolean filterProposals) Set the boolean that controls whether proposals are filtered according to the current field content.- Parameters:
filterProposals-trueif the proposals should be filtered to show only those that match the current contents of the field, andfalseif the proposals should remain the same, ignoring the field content.- Since:
- 3.3
-