java.lang.Object
de.grogra.pf.ui.autocomplete.impl.AbstractCompletion
de.grogra.pf.ui.autocomplete.impl.BasicCompletion
de.grogra.pf.ui.autocomplete.impl.ShorthandCompletion
- All Implemented Interfaces:
Completion
,Comparable<Completion>
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
- Author:
- Robert Futrell
-
Constructor Summary
ConstructorDescriptionShorthandCompletion
(CompletionProvider provider, String inputText, String replacementText) Constructor.ShorthandCompletion
(CompletionProvider provider, String inputText, String replacementText, String shortDesc) Constructor.ShorthandCompletion
(CompletionProvider provider, String inputText, String replacementText, String shortDesc, String summary) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the text the user must start typing to get this completion.If a summary has been set, that summary is returned.protected String
Returns the "body" of the HTML returned bygetSummary()
when no summary text has been set.Methods inherited from class de.grogra.pf.ui.autocomplete.impl.BasicCompletion
getReplacementText, getShortDescription, setShortDescription, setSummary, toString
Methods inherited from class de.grogra.pf.ui.autocomplete.impl.AbstractCompletion
compareTo, getAlreadyEntered, getCompareString, getIcon, getProvider, getRelevance, getToolTipText, setIcon, setRelevance
-
Constructor Details
-
ShorthandCompletion
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, String inputText, String replacementText, 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, String inputText, String replacementText, String shortDesc, 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 Details
-
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:
-
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:
-
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:
-