|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fife.ui.autocomplete.CompletionProviderBase
org.fife.ui.autocomplete.LanguageAwareCompletionProvider
A completion provider for the C programming language (and other languages with similar syntax). This provider simply delegates to another provider, depending on whether the caret is in:
This provider also implements the
org.fife.ui.rtextarea.ToolTipSupplier interface, which allows it
to display tooltips for completion choices. Thus the standard
VariableCompletion and FunctionCompletion completions should
be able to display tooltips with the variable declaration or function
definition (provided the RSyntaxTextArea was registered with the
javax.swing.ToolTipManager).
| Field Summary |
| Fields inherited from class org.fife.ui.autocomplete.CompletionProviderBase |
EMPTY_STRING |
| Constructor Summary | |
protected |
LanguageAwareCompletionProvider()
Constructor subclasses can use when they don't have their default provider created at construction time. |
|
LanguageAwareCompletionProvider(CompletionProvider defaultProvider)
Constructor. |
| Method Summary | |
void |
clearParameterizedCompletionParams()
Calling this method will result in an UnsupportedOperationException being thrown. |
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. |
CompletionProvider |
getCommentCompletionProvider()
Returns the completion provider to use for comments. |
java.util.List |
getCompletionsAt(javax.swing.text.JTextComponent tc,
java.awt.Point p)
Returns the completions that have been entered at the specified visual location. This can be used for tool tips when the user hovers the mouse over completed text. |
protected java.util.List |
getCompletionsImpl(javax.swing.text.JTextComponent comp)
Does the dirty work of creating a list of completions. |
CompletionProvider |
getDefaultCompletionProvider()
Returns the completion provider used when one isn't defined for a particular token type. |
CompletionProvider |
getDocCommentCompletionProvider()
Returns the completion provider to use for documentation comments. |
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 |
getStringCompletionProvider()
Returns the completion provider to use for strings. |
java.lang.String |
getToolTipText(org.fife.ui.rtextarea.RTextArea textArea,
java.awt.event.MouseEvent e)
Returns the tool tip to display for a mouse event. |
void |
setCommentCompletionProvider(CompletionProvider provider)
Sets the comment completion provider. |
void |
setDefaultCompletionProvider(CompletionProvider provider)
Sets the default completion provider. |
void |
setDocCommentCompletionProvider(CompletionProvider provider)
Sets the documentation comment completion provider. |
void |
setParameterizedCompletionParams(char listStart,
java.lang.String separator,
char listEnd)
Calling this method will result in an UnsupportedOperationException being thrown. |
void |
setStringCompletionProvider(CompletionProvider provider)
Sets the completion provider to use while in a string. |
| Methods inherited from class org.fife.ui.autocomplete.CompletionProviderBase |
getCompletions, getListCellRenderer, getParent, setListCellRenderer, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected LanguageAwareCompletionProvider()
setDefaultCompletionProvider(CompletionProvider) in this
constructor.
public LanguageAwareCompletionProvider(CompletionProvider defaultProvider)
defaultProvider - The provider to use when no provider is assigned
to a particular token type. This cannot be null.| Method Detail |
public void clearParameterizedCompletionParams()
UnsupportedOperationException being thrown. To set the
parameter completion parameters, do so on the provider returned by
getDefaultCompletionProvider().
clearParameterizedCompletionParams in interface CompletionProviderclearParameterizedCompletionParams in class CompletionProviderBasejava.lang.UnsupportedOperationException - Always.setParameterizedCompletionParams(char, String, char)public java.lang.String getAlreadyEnteredText(javax.swing.text.JTextComponent comp)
getAlreadyEnteredText in interface CompletionProvidercomp - 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 CompletionProvider getCommentCompletionProvider()
setCommentCompletionProvider(CompletionProvider)
public java.util.List getCompletionsAt(javax.swing.text.JTextComponent tc,
java.awt.Point p)
getCompletionsAt in interface CompletionProvidertc - The text component.p - The position, usually from a MouseEvent.
protected java.util.List getCompletionsImpl(javax.swing.text.JTextComponent comp)
getCompletionsImpl in class CompletionProviderBasecomp - The text component to look in.
public CompletionProvider getDefaultCompletionProvider()
setDefaultCompletionProvider(CompletionProvider)public CompletionProvider getDocCommentCompletionProvider()
setDocCommentCompletionProvider(CompletionProvider)public java.util.List getParameterizedCompletions(javax.swing.text.JTextComponent tc)
getParameterizedCompletions in interface CompletionProvidertc - The text component.
ParameterizedCompletions. If no completions
are available, this may be null.public char getParameterListEnd()
getParameterListEnd in interface CompletionProvidergetParameterListEnd in class CompletionProviderBasepublic java.lang.String getParameterListSeparator()
getParameterListSeparator in interface CompletionProvidergetParameterListSeparator in class CompletionProviderBasepublic char getParameterListStart()
getParameterListStart in interface CompletionProvidergetParameterListStart in class CompletionProviderBasepublic CompletionProvider getStringCompletionProvider()
setStringCompletionProvider(CompletionProvider)public void setCommentCompletionProvider(CompletionProvider provider)
provider - The provider to use in comments.getCommentCompletionProvider()public void setDefaultCompletionProvider(CompletionProvider provider)
provider - The provider to use when no provider is assigned to a
particular token type. This cannot be null.getDefaultCompletionProvider()public void setDocCommentCompletionProvider(CompletionProvider provider)
provider - The provider to use in comments.getDocCommentCompletionProvider()
public void setParameterizedCompletionParams(char listStart,
java.lang.String separator,
char listEnd)
UnsupportedOperationException being thrown. To set the
parameter completion parameters, do so on the provider returned by
getDefaultCompletionProvider().
setParameterizedCompletionParams in interface CompletionProvidersetParameterizedCompletionParams in class CompletionProviderBasejava.lang.UnsupportedOperationException - Always.clearParameterizedCompletionParams()public void setStringCompletionProvider(CompletionProvider provider)
provider - The provider to use.getStringCompletionProvider()
public java.lang.String getToolTipText(org.fife.ui.rtextarea.RTextArea textArea,
java.awt.event.MouseEvent e)
For this method to be called, the RSyntaxTextArea must be registered with the javax.swing.ToolTipManager like so:
ToolTipManager.sharedInstance().registerComponent(textArea);
getToolTipText in interface org.fife.ui.rtextarea.ToolTipSuppliertextArea - The text area.e - The mouse event.
null if none.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||