public final class StringCompletionProvider extends java.lang.Object implements CompletionProvider<java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
javax.swing.DefaultListCellRenderer |
renderer |
| Constructor and Description |
|---|
StringCompletionProvider(java.util.Collection<java.lang.String> strings)
Create a provider with the collection of strings to offer to the user
in the popup for this completion field.
|
| Modifier and Type | Method and Description |
|---|---|
void |
completeInsight(javax.swing.text.Document doc,
int pos,
java.lang.String insightObject)
Complete insight for the specified position in the specified document,
using the specified insight object.
|
javax.swing.ListCellRenderer |
getCellRenderer()
Get the cell renderer used for the completion list this provider handles.
|
java.lang.String[] |
getInsightData(javax.swing.text.Document doc,
int pos)
Get insight data for the specified position in the specified document.
|
boolean |
handlesInsight(javax.swing.text.Document doc,
int pos)
Does this provider handle insight for the specified document? This method
is normally called when an insight trigger of some kind happens (e.g.
|
boolean |
isAutoPopupChar(char c)
Should the specified character trigger an automatic popup completion
list that might be handled by this insight provider?
|
public StringCompletionProvider(java.util.Collection<java.lang.String> strings)
strings - public javax.swing.ListCellRenderer getCellRenderer()
CompletionProvidergetCellRenderer in interface CompletionProvider<java.lang.String>public boolean handlesInsight(javax.swing.text.Document doc,
int pos)
CompletionProviderhandlesInsight in interface CompletionProvider<java.lang.String>doc - the document of the component to provide insight forpos - the current caret position within the documentpublic java.lang.String[] getInsightData(javax.swing.text.Document doc,
int pos)
CompletionProvidergetInsightData in interface CompletionProvider<java.lang.String>doc - the document to provide insight forpos - the current caret position within the documentpublic void completeInsight(javax.swing.text.Document doc,
int pos,
java.lang.String insightObject)
CompletionProvidercompleteInsight in interface CompletionProvider<java.lang.String>doc - the document to completepos - the position to complete atinsightObject - the insight object to complete withpublic boolean isAutoPopupChar(char c)
CompletionProviderisAutoPopupChar in interface CompletionProvider<java.lang.String>c - the character before the caret position.