public abstract class AbstractCompletionProvider extends CompletionProviderBase
Completion
s are kept in
a sorted list. To get the list of completions that match a given input,
a binary search is done to find the first matching completion, then all
succeeding completions that also match are also returned.限定符和类型 | 类和说明 |
---|---|
protected static class |
AbstractCompletionProvider.CaseInsensitiveComparator
A comparator that compares the input text of a
Completion
against a String lexicographically, ignoring case. |
限定符和类型 | 字段和说明 |
---|---|
protected AbstractCompletionProvider.CaseInsensitiveComparator |
comparator
Compares a
Completion against a String. |
protected java.util.List<Completion> |
completions
The completions this provider is aware of.
|
EMPTY_STRING
构造器和说明 |
---|
AbstractCompletionProvider()
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addCompletion(Completion c)
Adds a single completion to this provider.
|
void |
addCompletions(java.util.List<Completion> completions)
Adds
Completion s to this provider. |
protected void |
addWordCompletions(java.lang.String[] words)
Adds simple completions for a list of words.
|
protected void |
checkProviderAndAdd(Completion c) |
void |
clear()
Removes all completions from this provider.
|
java.util.List<Completion> |
getCompletionByInputText(java.lang.String inputText)
Returns a list of Completions in this provider with the
specified input text.
|
protected java.util.List<Completion> |
getCompletionsImpl(javax.swing.text.JTextComponent comp)
Does the dirty work of creating a list of completions.
|
boolean |
removeCompletion(Completion c)
Removes the specified completion from this provider.
|
clearParameterizedCompletionParams, getCompletions, getListCellRenderer, getParameterChoicesProvider, getParameterListEnd, getParameterListSeparator, getParameterListStart, getParent, isAutoActivateOkay, setAutoActivationRules, setListCellRenderer, setParameterChoicesProvider, setParameterizedCompletionParams, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAlreadyEnteredText, getCompletionsAt, getParameterizedCompletions
protected java.util.List<Completion> completions
protected AbstractCompletionProvider.CaseInsensitiveComparator comparator
Completion
against a String.public void addCompletion(Completion c)
addCompletions(List)
instead.c
- The completion to add.java.lang.IllegalArgumentException
- If the completion's provider isn't
this CompletionProvider.addCompletions(List)
,
removeCompletion(Completion)
,
clear()
public void addCompletions(java.util.List<Completion> completions)
Completion
s to this provider.completions
- The completions to add. This cannot be
null
.java.lang.IllegalArgumentException
- If a completion's provider isn't
this CompletionProvider.addCompletion(Completion)
,
removeCompletion(Completion)
,
clear()
protected void addWordCompletions(java.lang.String[] words)
words
- The words.BasicCompletion
protected void checkProviderAndAdd(Completion c)
public void clear()
public java.util.List<Completion> getCompletionByInputText(java.lang.String inputText)
inputText
- The input text to search for.Completion
s, or null
if there
are no matching Completions.protected java.util.List<Completion> getCompletionsImpl(javax.swing.text.JTextComponent comp)
getCompletionsImpl
在类中 CompletionProviderBase
comp
- The text component to look in.public boolean removeCompletion(Completion c)
c
- The completion to remove.true
if this provider contained the specified
completion.clear()
,
addCompletion(Completion)
,
addCompletions(List)