public class VariableCompletion extends BasicCompletion
This completion type uses its shortDescription property as part of
its summary returned by getSummary()
; for this reason, it may be
a little longer (even much longer), if desired, than what is recommended
for BasicCompletions (where the shortDescription is used
in toString()
for ListCellRenderers).
构造器和说明 |
---|
VariableCompletion(CompletionProvider provider,
java.lang.String name,
java.lang.String type)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
addDefinitionString(java.lang.StringBuilder sb) |
java.lang.String |
getDefinedIn()
Returns where this variable is defined.
|
java.lang.String |
getDefinitionString() |
java.lang.String |
getName()
Returns the name of this variable.
|
java.lang.String |
getSummary()
Returns the description of this auto-complete choice.
|
java.lang.String |
getToolTipText()
Returns the tool tip text to display for mouse hovers over this
completion.
|
java.lang.String |
getType()
Returns the type of this variable.
|
protected void |
possiblyAddDefinedIn(java.lang.StringBuilder sb)
Adds some HTML describing where this variable is defined, if this
information is known.
|
protected boolean |
possiblyAddDescription(java.lang.StringBuilder sb)
Adds the description text as HTML to a buffer, if a description is
defined.
|
void |
setDefinedIn(java.lang.String definedIn)
Sets where this variable is defined.
|
java.lang.String |
toString()
Overridden to return the name of the variable being completed.
|
getReplacementText, getShortDescription, setShortDescription, setSummary
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, setRelevance
public VariableCompletion(CompletionProvider provider, java.lang.String name, java.lang.String type)
provider
- The parent provider.name
- The name of this variable.type
- The type of this variable (e.g. "int
",
"String
", etc.).protected void addDefinitionString(java.lang.StringBuilder sb)
public java.lang.String getDefinitionString()
public java.lang.String getDefinedIn()
setDefinedIn(String)
public java.lang.String getName()
public java.lang.String getSummary()
getSummary
在接口中 Completion
getSummary
在类中 BasicCompletion
null
if there is no description for this
completion.public java.lang.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
在接口中 Completion
getToolTipText
在类中 AbstractCompletion
null
if
none.public java.lang.String getType()
protected void possiblyAddDefinedIn(java.lang.StringBuilder sb)
sb
- The buffer to append to.protected boolean possiblyAddDescription(java.lang.StringBuilder sb)
sb
- The buffer to append to.public void setDefinedIn(java.lang.String definedIn)
definedIn
- Where this variable is defined.getDefinedIn()
public java.lang.String toString()
toString
在类中 BasicCompletion