public class FunctionCompletion extends VariableCompletion implements ParameterizedCompletion
ParameterizedCompletion.Parameter
Constructor and Description |
---|
FunctionCompletion(CompletionProvider provider,
String name,
String returnType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDefinitionString(StringBuilder sb) |
protected void |
addParameters(StringBuilder sb)
Adds HTML describing the parameters to this function to a buffer.
|
String |
getDefinitionString()
Returns the "definition string" for this function completion.
|
org.fife.ui.autocomplete.ParameterizedCompletionInsertionInfo |
getInsertionInfo(JTextComponent tc,
boolean replaceTabsWithSpaces) |
ParameterizedCompletion.Parameter |
getParam(int index)
Returns the specified
ParameterizedCompletion.Parameter . |
int |
getParamCount()
Returns the number of parameters to this function.
|
String |
getReturnValueDescription()
Returns the description of the return value of this function.
|
boolean |
getShowParameterToolTip()
Returns whether a tool tip displaying assistance for each parameter
while it is being edited is appropriate for this completion.
|
String |
getSummary()
Returns the description of this auto-complete choice.
|
String |
getToolTipText()
Returns the tool tip text to display for mouse hovers over this
completion.
|
void |
setParams(List<ParameterizedCompletion.Parameter> params)
Sets the parameters to this function.
|
void |
setReturnValueDescription(String desc)
Sets the description of the return value of this function.
|
getDefinedIn, getName, getType, possiblyAddDefinedIn, possiblyAddDescription, setDefinedIn, toString
getReplacementText, getShortDescription, setShortDescription, setSummary
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, setRelevance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, getReplacementText
public FunctionCompletion(CompletionProvider provider, String name, String returnType)
provider
- The parent provider.name
- The name of this function.returnType
- The return type of this function.protected void addDefinitionString(StringBuilder sb)
addDefinitionString
in class VariableCompletion
protected void addParameters(StringBuilder sb)
sb
- The buffer to append to.public String getDefinitionString()
printf
" function, this would return
"int printf(const char *, ...)
".getDefinitionString
in interface ParameterizedCompletion
getDefinitionString
in class VariableCompletion
public org.fife.ui.autocomplete.ParameterizedCompletionInsertionInfo getInsertionInfo(JTextComponent tc, boolean replaceTabsWithSpaces)
getInsertionInfo
in interface ParameterizedCompletion
public ParameterizedCompletion.Parameter getParam(int index)
ParameterizedCompletion.Parameter
.getParam
in interface ParameterizedCompletion
index
- The index of the parameter to retrieve.ParameterizedCompletion.getParamCount()
public int getParamCount()
getParamCount
in interface ParameterizedCompletion
getParam(int)
public boolean getShowParameterToolTip()
getShowParameterToolTip
in interface ParameterizedCompletion
public String getReturnValueDescription()
null
if there is none.setReturnValueDescription(String)
public String getSummary()
getSummary
in interface Completion
getSummary
in class VariableCompletion
null
if there is no description for this
completion.public String getToolTipText()
Note that for this functionality to be enabled, a
JTextComponent must be registered with the
ToolTipManager, and the text component must know to search
for this value. In the case of an
RSyntaxTextArea, this
can be done with a org.fife.ui.rtextarea.ToolTipSupplier that
calls into
CompletionProvider.getCompletionsAt(JTextComponent, java.awt.Point)
.
getToolTipText
in interface Completion
getToolTipText
in class VariableCompletion
null
if
none.public void setParams(List<ParameterizedCompletion.Parameter> params)
params
- The parameters. This should be a list of
ParameterizedCompletion.Parameter
s.getParam(int)
,
getParamCount()
public void setReturnValueDescription(String desc)
desc
- The description.getReturnValueDescription()