|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CompletionProvider
Provides autocompletion values to an AutoCompletion.
Completion providers can have an optional parent. Parents are searched for completions when their children are. This allows for chaining of completion providers.
| Method Summary | |
|---|---|
void |
clearParameterizedCompletionParams()
Clears the values used to identify and insert "parameterized completions" (e.g. |
String |
getAlreadyEnteredText(JTextComponent comp)
Returns the text just before the current caret position that could be the start of something auto-completable. |
List |
getCompletions(JTextComponent comp)
Gets the possible completions for the text component at the current caret position. |
List |
getCompletionsAt(JTextComponent comp,
Point p)
Returns the completions that have been entered at the specified visual location. |
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. |
List |
getParameterizedCompletions(JTextComponent tc)
Returns a list of parameterized completions that have been entered at the current caret position of a text component (and thus can have their completion choices displayed). |
char |
getParameterListEnd()
Returns the text that marks the end of a list of parameters to a function or method. |
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(JTextComponent tc)
This method is called if auto-activation is enabled in the parent AutoCompletion after the user types a single character. |
void |
setListCellRenderer(ListCellRenderer r)
Sets the renderer to use when displaying completion choices. |
void |
setParameterizedCompletionParams(char listStart,
String separator,
char listEnd)
Sets the values used to identify and insert "parameterized completions" (e.g. |
void |
setParent(CompletionProvider parent)
Sets the parent completion provider. |
| Method Detail |
|---|
void clearParameterizedCompletionParams()
setParameterizedCompletionParams(char, String, char)String getAlreadyEnteredText(JTextComponent comp)
comp - The text component.
null means nothing
should be auto-completed; a value of an empty string
("") means auto-completion should still be
considered (i.e., all possible choices are valid).List getCompletions(JTextComponent comp)
comp - The text component.
Completions. If no completions are
available, this may be null.
List getCompletionsAt(JTextComponent comp,
Point p)
comp - The text component.p - The position, usually from a MouseEvent.
ListCellRenderer getListCellRenderer()
null if the default should
be used.setListCellRenderer(ListCellRenderer)ParameterChoicesProvider getParameterChoicesProvider()
null if
none is installed.List getParameterizedCompletions(JTextComponent tc)
tc - The text component.
ParameterizedCompletions. If no completions
are available, this may be null.char getParameterListEnd()
)'.getParameterListStart(),
getParameterListSeparator(),
setParameterizedCompletionParams(char, String, char)String getParameterListSeparator()
, ".getParameterListStart(),
getParameterListEnd(),
setParameterizedCompletionParams(char, String, char)char getParameterListStart()
(".getParameterListEnd(),
getParameterListSeparator(),
setParameterizedCompletionParams(char, String, char)CompletionProvider getParent()
setParent(CompletionProvider)boolean isAutoActivateOkay(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 '.'.
tc - The text component.
void setListCellRenderer(ListCellRenderer r)
r - The renderer to use.getListCellRenderer()
void setParameterizedCompletionParams(char listStart,
String separator,
char listEnd)
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.
IllegalArgumentException - If either listStart or
listEnd is not printable ASCII, or if
separator is null or an empty string.clearParameterizedCompletionParams()void setParent(CompletionProvider parent)
parent - The parent provider. null means there will
be no parent provider.getParent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||