|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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. functions or methods). |
java.lang.String |
getAlreadyEnteredText(javax.swing.text.JTextComponent comp)
Returns the text just before the current caret position that could be the start of something auto-completable. |
java.util.List |
getCompletions(javax.swing.text.JTextComponent comp)
Gets the possible completions for the text component at the current caret position. |
java.util.List |
getCompletionsAt(javax.swing.text.JTextComponent comp,
java.awt.Point p)
Returns the completions that have been entered at the specified visual location. |
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. |
java.util.List |
getParameterizedCompletions(javax.swing.text.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. |
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 |
setListCellRenderer(javax.swing.ListCellRenderer r)
Sets the renderer to use when displaying completion choices. |
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. |
| Method Detail |
public void clearParameterizedCompletionParams()
setParameterizedCompletionParams(char, String, char)public java.lang.String getAlreadyEnteredText(javax.swing.text.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).public java.util.List getCompletions(javax.swing.text.JTextComponent comp)
comp - The text component.
Completions. If no completions are
available, this may be null.
public java.util.List getCompletionsAt(javax.swing.text.JTextComponent comp,
java.awt.Point p)
comp - The text component.p - The position, usually from a MouseEvent.
public javax.swing.ListCellRenderer getListCellRenderer()
null if the default should
be used.setListCellRenderer(ListCellRenderer)public ParameterChoicesProvider getParameterChoicesProvider()
null if
none is installed.public java.util.List getParameterizedCompletions(javax.swing.text.JTextComponent tc)
tc - The text component.
ParameterizedCompletions. If no completions
are available, this may be null.public char getParameterListEnd()
)'.getParameterListStart(),
getParameterListSeparator(),
setParameterizedCompletionParams(char, String, char)public java.lang.String getParameterListSeparator()
, ".getParameterListStart(),
getParameterListEnd(),
setParameterizedCompletionParams(char, String, char)public char getParameterListStart()
(".getParameterListEnd(),
getParameterListSeparator(),
setParameterizedCompletionParams(char, String, char)public CompletionProvider getParent()
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 '.'.
tc - The text component.
public void setListCellRenderer(javax.swing.ListCellRenderer r)
r - The renderer to use.getListCellRenderer()
public void setParameterizedCompletionParams(char listStart,
java.lang.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.
java.lang.IllegalArgumentException - If either listStart or
listEnd is not printable ASCII, or if
separator is null or an empty string.clearParameterizedCompletionParams()public 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 | ||||||||