public abstract class CompletionProviderBase extends java.lang.Object implements CompletionProvider
AbstractCompletionProvider
限定符和类型 | 字段和说明 |
---|---|
protected static java.lang.String |
EMPTY_STRING |
构造器和说明 |
---|
CompletionProviderBase() |
限定符和类型 | 方法和说明 |
---|---|
void |
clearParameterizedCompletionParams()
Clears the values used to identify and insert "parameterized completions"
(e.g. functions or methods).
|
java.util.List<Completion> |
getCompletions(javax.swing.text.JTextComponent comp)
Gets the possible completions for the text component at the current
caret position.
|
protected abstract java.util.List<Completion> |
getCompletionsImpl(javax.swing.text.JTextComponent comp)
Does the dirty work of creating a list of completions.
|
javax.swing.ListCellRenderer |
getListCellRenderer()
Returns the cell renderer for completions returned from this provider.
|
ParameterChoicesProvider |
getParameterChoicesProvider()
Returns an object that can return a list of completion choices for
parameters.
|
char |
getParameterListEnd()
Returns the text that marks the end of a list of parameters to a
function or method.
|
java.lang.String |
getParameterListSeparator()
Returns the text that separates parameters to a function or method.
|
char |
getParameterListStart()
Returns the text that marks the start of a list of parameters to a
function or method.
|
CompletionProvider |
getParent()
Returns the parent completion provider.
|
boolean |
isAutoActivateOkay(javax.swing.text.JTextComponent tc)
This method is called if auto-activation is enabled in the parent
AutoCompletion after the user types a single character. |
void |
setAutoActivationRules(boolean letters,
java.lang.String others)
Sets the characters that auto-activation should occur after.
|
void |
setListCellRenderer(javax.swing.ListCellRenderer r)
Sets the renderer to use when displaying completion choices.
|
void |
setParameterChoicesProvider(ParameterChoicesProvider pcp)
Sets the param choices provider.
|
void |
setParameterizedCompletionParams(char listStart,
java.lang.String separator,
char listEnd)
Sets the values used to identify and insert "parameterized completions"
(e.g. functions or methods).
|
void |
setParent(CompletionProvider parent)
Sets the parent completion provider.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAlreadyEnteredText, getCompletionsAt, getParameterizedCompletions
protected static final java.lang.String EMPTY_STRING
public void clearParameterizedCompletionParams()
public java.util.List<Completion> getCompletions(javax.swing.text.JTextComponent comp)
getCompletions
在接口中 CompletionProvider
comp
- The text component.Completion
s. If no completions are
available, this may be null
.protected abstract java.util.List<Completion> getCompletionsImpl(javax.swing.text.JTextComponent comp)
comp
- The text component to look in.public javax.swing.ListCellRenderer getListCellRenderer()
getListCellRenderer
在接口中 CompletionProvider
null
if the default should
be used.CompletionProvider.setListCellRenderer(ListCellRenderer)
public ParameterChoicesProvider getParameterChoicesProvider()
getParameterChoicesProvider
在接口中 CompletionProvider
null
if
none is installed.public char getParameterListEnd()
getParameterListEnd
在接口中 CompletionProvider
)
'.CompletionProvider.getParameterListStart()
,
CompletionProvider.getParameterListSeparator()
,
CompletionProvider.setParameterizedCompletionParams(char, String, char)
public java.lang.String getParameterListSeparator()
getParameterListSeparator
在接口中 CompletionProvider
,
".CompletionProvider.getParameterListStart()
,
CompletionProvider.getParameterListEnd()
,
CompletionProvider.setParameterizedCompletionParams(char, String, char)
public char getParameterListStart()
getParameterListStart
在接口中 CompletionProvider
(
".CompletionProvider.getParameterListEnd()
,
CompletionProvider.getParameterListSeparator()
,
CompletionProvider.setParameterizedCompletionParams(char, String, char)
public CompletionProvider getParent()
getParent
在接口中 CompletionProvider
CompletionProvider.setParent(CompletionProvider)
public boolean isAutoActivateOkay(javax.swing.text.JTextComponent tc)
AutoCompletion
after the user types a single character. This
provider should check the text at the current caret position of the
text component, and decide whether auto-activation would be appropriate
here. For example, a CompletionProvider
for Java might
want to return true
for this method only if the last
character typed was a '.
'.isAutoActivateOkay
在接口中 CompletionProvider
tc
- The text component.public void setAutoActivationRules(boolean letters, java.lang.String others)
others
to ".
", to allow auto-activation for members of an object.letters
- Whether auto-activation should occur after any letter.others
- A string of (non-letter) chars that auto-activation should
occur after. This may be null
.public void setParameterChoicesProvider(ParameterChoicesProvider pcp)
pcp
- The parameter choices provider, or null
for
none.getParameterChoicesProvider()
public void setListCellRenderer(javax.swing.ListCellRenderer r)
setListCellRenderer
在接口中 CompletionProvider
r
- The renderer to use.CompletionProvider.getListCellRenderer()
public void setParameterizedCompletionParams(char listStart, java.lang.String separator, char listEnd)
setParameterizedCompletionParams
在接口中 CompletionProvider
listStart
- The character that marks the beginning of a list of
parameters, such as '(' in C or Java.separator
- Text that should separate parameters in a parameter
list when one is inserted. For example, ", ".listEnd
- The character that marks the end of a list of parameters,
such as ')' in C or Java.CompletionProvider.clearParameterizedCompletionParams()
public void setParent(CompletionProvider parent)
setParent
在接口中 CompletionProvider
parent
- The parent provider. null
means there will
be no parent provider.CompletionProvider.getParent()