Package org.fife.ui.autocomplete
Class ShorthandCompletion
- java.lang.Object
-
- org.fife.ui.autocomplete.AbstractCompletion
-
- org.fife.ui.autocomplete.BasicCompletion
-
- org.fife.ui.autocomplete.ShorthandCompletion
-
- All Implemented Interfaces:
java.lang.Comparable<Completion>
,Completion
public class ShorthandCompletion extends BasicCompletion
A completion where the input text is shorthand for (really, just different from) the actual text to be inserted. For example, the input text "sysout
" could be associated with the completion "System.out.println(
" in Java.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
inputText
The text the user can start typing that will match this completion.
-
Constructor Summary
Constructors Constructor Description ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText)
Constructor.ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText, java.lang.String shortDesc)
Constructor.ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText, java.lang.String shortDesc, java.lang.String summary)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getInputText()
Returns the text the user must start typing to get this completion.java.lang.String
getSummary()
If a summary has been set, that summary is returned.protected java.lang.String
getSummaryBody()
Returns the "body" of the HTML returned bygetSummary()
when no summary text has been set.-
Methods inherited from class org.fife.ui.autocomplete.BasicCompletion
getReplacementText, getShortDescription, setShortDescription, setSummary, toString
-
Methods inherited from class org.fife.ui.autocomplete.AbstractCompletion
compareTo, getAlreadyEntered, getIcon, getProvider, getRelevance, getToolTipText, setIcon, setRelevance
-
-
-
-
Constructor Detail
-
ShorthandCompletion
public ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText)
Constructor.- Parameters:
provider
- The provider that returns this completion.inputText
- The text the user inputs to get this completion.replacementText
- The replacement text of the completion.
-
ShorthandCompletion
public ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText, java.lang.String shortDesc)
Constructor.- Parameters:
provider
- The provider that returns this completion.inputText
- The text the user inputs to get this completion.replacementText
- The replacement text of the completion.shortDesc
- A short description of the completion. This will be displayed in the completion list. This may benull
.
-
ShorthandCompletion
public ShorthandCompletion(CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText, java.lang.String shortDesc, java.lang.String summary)
Constructor.- Parameters:
provider
- The provider that returns this completion.inputText
- The text the user inputs to get this completion.replacementText
- The replacement text of the completion.shortDesc
- A short description of the completion. This will be displayed in the completion list. This may benull
.summary
- The summary of this completion. This should be HTML. This may benull
.
-
-
Method Detail
-
getInputText
public java.lang.String getInputText()
Returns the text the user must start typing to get this completion.- Specified by:
getInputText
in interfaceCompletion
- Overrides:
getInputText
in classAbstractCompletion
- Returns:
- The text the user must start to input.
- See Also:
Completion.getReplacementText()
-
getSummary
public java.lang.String getSummary()
If a summary has been set, that summary is returned. Otherwise, the replacement text is returned.- Specified by:
getSummary
in interfaceCompletion
- Overrides:
getSummary
in classBasicCompletion
- Returns:
- A description of this completion (the text that will be inserted).
- See Also:
BasicCompletion.getReplacementText()
-
getSummaryBody
protected java.lang.String getSummaryBody()
Returns the "body" of the HTML returned bygetSummary()
when no summary text has been set. This is defined to return the replacement text in a monospaced font.- Returns:
- The summary text's body, if no other summary has been defined.
- See Also:
BasicCompletion.getReplacementText()
-
-