java.lang.Object
de.grogra.pf.ui.autocomplete.impl.AbstractCompletion
de.grogra.pf.ui.autocomplete.impl.BasicCompletion
de.grogra.pf.ui.autocomplete.impl.VariableCompletion
de.grogra.pf.ui.autocomplete.impl.FunctionCompletion
- All Implemented Interfaces:
Completion
,ParameterizedCompletion
,Comparable<Completion>
A completion choice representing a function.
In order to use any instance of a ParameterizedCompletion
, you need
to call AutoCompletion#setParameterAssistanceEnabled(boolean)
with
a value of true
first. Otherwise, any completion choices will be
visible in the completion list, but won't insert anything when selected.
- Version:
- 1.0
- Author:
- Robert Futrell
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.pf.ui.autocomplete.impl.ParameterizedCompletion
ParameterizedCompletion.Parameter
-
Constructor Summary
ConstructorDescriptionFunctionCompletion
(CompletionProvider provider, String name, String returnType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
Adds HTML describing the parameters to this function to a buffer.boolean
Overridden to match the behavior ofcompareTo(Completion)
.Returns a string used to compare this method completion to another.Returns the "definition string" for this function completion.getInsertionInfo
(AutoCompletableTextArea tc, boolean replaceTabsWithSpaces) Returns completion information for this parameterized completion, given the specified text component.getParam
(int index) Returns the specifiedParameterizedCompletion.Parameter
.int
Returns the number of parameters to this function.Returns the description of the return value of this function.boolean
Returns whether a tool tip displaying assistance for each parameter while it is being edited is appropriate for this completion.Returns the description of this auto-complete choice.Returns the tool tip text to display for mouse hovers over this completion.int
hashCode()
void
Sets the parameters to this function.void
Sets the description of the return value of this function.Methods inherited from class de.grogra.pf.ui.autocomplete.impl.VariableCompletion
getDefinedIn, getName, getType, possiblyAddDefinedIn, possiblyAddDescription, setDefinedIn, toString
Methods inherited from class de.grogra.pf.ui.autocomplete.impl.BasicCompletion
getReplacementText, getShortDescription, setShortDescription, setSummary
Methods inherited from class de.grogra.pf.ui.autocomplete.impl.AbstractCompletion
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, setIcon, setRelevance
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.grogra.pf.ui.autocomplete.impl.Completion
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, getReplacementText
-
Constructor Details
-
FunctionCompletion
Constructor.- Parameters:
provider
- The parent provider.name
- The name of this function.returnType
- The return type of this function.
-
-
Method Details
-
addDefinitionString
- Overrides:
addDefinitionString
in classVariableCompletion
-
addParameters
Adds HTML describing the parameters to this function to a buffer.- Parameters:
sb
- The buffer to append to.
-
equals
Overridden to match the behavior ofcompareTo(Completion)
. -
getCompareString
Returns a string used to compare this method completion to another.- Specified by:
getCompareString
in interfaceCompletion
- Overrides:
getCompareString
in classAbstractCompletion
- Returns:
- The comparison string.
-
getDefinitionString
Returns the "definition string" for this function completion. For example, for the C "printf
" function, this would return "int printf(const char *, ...)
".- Specified by:
getDefinitionString
in interfaceParameterizedCompletion
- Overrides:
getDefinitionString
in classVariableCompletion
- Returns:
- The definition string.
-
getInsertionInfo
public ParameterizedCompletionInsertionInfo getInsertionInfo(AutoCompletableTextArea tc, boolean replaceTabsWithSpaces) Description copied from interface:ParameterizedCompletion
Returns completion information for this parameterized completion, given the specified text component.- Specified by:
getInsertionInfo
in interfaceParameterizedCompletion
- Parameters:
tc
- The text component.replaceTabsWithSpaces
- Whether to replace tabs with spaces.- Returns:
- The completion info.
-
getParam
Description copied from interface:ParameterizedCompletion
Returns the specifiedParameterizedCompletion.Parameter
.- Specified by:
getParam
in interfaceParameterizedCompletion
- Parameters:
index
- The index of the parameter to retrieve.- Returns:
- The parameter.
- See Also:
-
getParamCount
public int getParamCount()Returns the number of parameters to this function.- Specified by:
getParamCount
in interfaceParameterizedCompletion
- Returns:
- The number of parameters to this function.
- See Also:
-
getShowParameterToolTip
public boolean getShowParameterToolTip()Description copied from interface:ParameterizedCompletion
Returns whether a tool tip displaying assistance for each parameter while it is being edited is appropriate for this completion.- Specified by:
getShowParameterToolTip
in interfaceParameterizedCompletion
- Returns:
- Whether the tool tip is appropriate to display.
-
getReturnValueDescription
Returns the description of the return value of this function.- Returns:
- The description, or
null
if there is none. - See Also:
-
getSummary
Description copied from interface:Completion
Returns the description of this auto-complete choice. This can be used in a popup "description window."- Specified by:
getSummary
in interfaceCompletion
- Overrides:
getSummary
in classVariableCompletion
- Returns:
- This item's description. This should be HTML. It may be
null
if there is no description for this completion.
-
getToolTipText
Description copied from class:VariableCompletion
Returns the tool tip text to display for mouse hovers over this completion.Note that for this functionality to be enabled, a
JTextComponent
must be registered with theToolTipManager
, and the text component must know to search for this value. In the case of an RSyntaxTextArea, this can be done with aorg.fife.ui.rtextarea.ToolTipSupplier
that calls intoCompletionProvider.getCompletionsAt(JTextComponent, java.awt.Point)
.- Specified by:
getToolTipText
in interfaceCompletion
- Overrides:
getToolTipText
in classVariableCompletion
- Returns:
- The tool tip text for this completion, or
null
if none.
-
hashCode
public int hashCode() -
setParams
Sets the parameters to this function.- Parameters:
params
- The parameters. This should be a list ofParameterizedCompletion.Parameter
s.- See Also:
-
setReturnValueDescription
Sets the description of the return value of this function.- Parameters:
desc
- The description.- See Also:
-