public class BasicCompletion extends AbstractCompletion
Completion
implementation. This implementation
can be used if you have a relatively short number of static completions
with no (or short) summaries.
This implementation uses the replacement text as the input text. It also
includes a "short description" field, which (if non-null
), is
used in the completion choices list.
Constructor and Description |
---|
BasicCompletion(CompletionProvider provider,
String replacementText)
Constructor.
|
BasicCompletion(CompletionProvider provider,
String replacementText,
String shortDesc)
Constructor.
|
BasicCompletion(CompletionProvider provider,
String replacementText,
String shortDesc,
String summary)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getReplacementText()
Returns the text to insert as the result of this auto-completion.
|
String |
getShortDescription()
Returns the short description of this completion, usually used in
the completion choices list.
|
String |
getSummary()
Returns the description of this auto-complete choice.
|
void |
setShortDescription(String shortDesc)
Sets the short description of this completion.
|
void |
setSummary(String summary)
Sets the summary for this completion.
|
String |
toString()
Returns a string representation of this completion.
|
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, getToolTipText, setRelevance
public BasicCompletion(CompletionProvider provider, String replacementText)
provider
- The parent completion provider.replacementText
- The text to replace.public BasicCompletion(CompletionProvider provider, String replacementText, String shortDesc)
provider
- The parent completion provider.replacementText
- The text to replace.shortDesc
- A short description of the completion. This will be
displayed in the completion list. This may be null
.public BasicCompletion(CompletionProvider provider, String replacementText, String shortDesc, String summary)
provider
- The parent completion provider.replacementText
- The text to replace.shortDesc
- A short description of the completion. This will be
displayed in the completion list. This may be null
.summary
- The summary of this completion. This should be HTML.
This may be null
.public String getReplacementText()
Completion.getInputText()
public String getShortDescription()
null
if there is none.setShortDescription(String)
public String getSummary()
null
if there is no description for this
completion.public void setShortDescription(String shortDesc)
shortDesc
- The short description of this completion.getShortDescription()
public void setSummary(String summary)
summary
- The summary for this completion.getSummary()
public String toString()
null
, this method will return:
getInputText() + " - " + shortDesc
otherwise, it will return getInputText().toString
in class AbstractCompletion