Package docking.widgets.search
Class SearchLocationContext
java.lang.Object
docking.widgets.search.SearchLocationContext
- All Implemented Interfaces:
Comparable<SearchLocationContext>
A class to hold context representation for
SearchLocations.- See Also:
-
Field Summary
Fields -
Method Summary
ChangeModifier and TypeMethodDescriptionintcompareTo(SearchLocationContext other) booleanstatic SearchLocationContextget(SearchLocationContext context) A factory method to provided as a convenience to handle null context objects.static SearchLocationContextA factory method to create a context instance with the given text.Returns HTML text for this context.getBoldMatchingText(boolean includeLineNumber) Returns HTML text for this context.Returns text that is helpful for debugging, such as printing to a console.intReturns the line number or -1 if the value has not been set.Returns any sub-strings of this context's overall text that match client-defined input See theSearchLocationContextBuilderfor how to define matching text piecesThe full plain text of this context.getPlainText(boolean includeLineNumber) Returns the plain text of this context, without html markup.inthashCode()toString()
-
Field Details
-
EMPTY_CONTEXT
-
-
Method Details
-
get
A factory method to create a context instance with the given text. The context created this way will have no special HTML formatting applied bygetBoldMatchingText(), as no matching parts will be defined.- Parameters:
text- the text- Returns:
- the context
-
get
A factory method to provided as a convenience to handle null context objects.- Parameters:
context- the context to verify is not null- Returns:
- the given context or the
EMPTY_CONTEXTif the given context is null
-
getPlainText
The full plain text of this context. Any non-negative line number will be prepended to the text.- Returns:
- the text
-
getPlainText
Returns the plain text of this context, without html markup.- Parameters:
includeLineNumber- if true, any non-negative line number will be prepended to the text.- Returns:
- the text
-
getDebugText
Returns text that is helpful for debugging, such as printing to a console.- Returns:
- the text
-
getBoldMatchingText
Returns HTML text for this context. Any matching items embedded in the returned string will be bold. Any non-negative line number will be prepended to the text.- Returns:
- the text
-
getBoldMatchingText
Returns HTML text for this context. Any matching items embedded in the returned string will be bold.- Parameters:
includeLineNumber- if true, any non-negative line number will be prepended to the text.- Returns:
- the text
-
getMatches
Returns any sub-strings of this context's overall text that match client-defined input See theSearchLocationContextBuilderfor how to define matching text pieces- Returns:
- the matching strings
-
getLineNumber
public int getLineNumber()Returns the line number or -1 if the value has not been set.- Returns:
- the line number
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<SearchLocationContext>
-
hashCode
public int hashCode() -
equals
-