public abstract class SearchResultProducer extends java.lang.Object implements java.lang.Comparable<SearchResultProducer>
SearchResult
objects from given search keywords.SearchResult
are then consumed by a SearchResultConsumer
.Constructor and Description |
---|
SearchResultProducer() |
Modifier and Type | Method and Description |
---|---|
void |
addResult(SearchResult result,
SearchResultConsumer consumer)
Add the SearchResult to the result list.
|
int |
compareTo(SearchResultProducer o) |
void |
doSearch(java.lang.String[] words,
SearchResultConsumer consumer)
Deprecated.
Use
doSearch(String, SearchResultConsumer) instead |
void |
doSearch(java.lang.String text,
SearchResultConsumer consumer)
Performs the search request (internal).
|
abstract java.lang.String |
getName()
Returns the result producer name
|
int |
getOrder()
Returns the result producer order
|
java.util.List<SearchResult> |
getResults()
Returns the result list
|
java.lang.String |
getTooltipText()
Returns the tooltip displayed on the menu (in small under the label).
|
boolean |
hasWaitingSearch()
Returns true if there is a waiting search pending.
|
boolean |
isSearching()
Returns true if the search result producer is currently processing a search request.
|
void |
search(java.lang.String[] words,
SearchResultConsumer consumer)
Deprecated.
Use
search(String, SearchResultConsumer) instead. |
void |
search(java.lang.String text,
SearchResultConsumer consumer)
Performs the search request (asynchronous), mostly build the search result list.
|
void |
waitSearchComplete()
Wait for the search request to complete.
|
public SearchResultProducer()
public int getOrder()
public abstract java.lang.String getName()
public java.lang.String getTooltipText()
public java.util.List<SearchResult> getResults()
@Deprecated public void search(java.lang.String[] words, SearchResultConsumer consumer)
search(String, SearchResultConsumer)
instead.public void search(java.lang.String text, SearchResultConsumer consumer)
text
- Search text, it can contains several words and use operators.consumer
- Search result consumer for this search request.SearchResultConsumer.resultsChanged(SearchResultProducer)
method.@Deprecated public void doSearch(java.lang.String[] words, SearchResultConsumer consumer)
doSearch(String, SearchResultConsumer)
insteadpublic void doSearch(java.lang.String text, SearchResultConsumer consumer)
results
list :results
should be
cleared.results
variable access should be synchronized as it can be externally accessed.hasWaitingSearch()
returns true.text
- Search text, it can contains several words and use operators.consumer
- Search result consumer for this search request.SearchResultConsumer.resultsChanged(SearchResultProducer)
method.hasWaitingSearch()
public void waitSearchComplete()
public boolean isSearching()
public boolean hasWaitingSearch()
public void addResult(SearchResult result, SearchResultConsumer consumer)
result
- Result to add to the result list.consumer
- If not null then consumer is notified about result changepublic int compareTo(SearchResultProducer o)
compareTo
in interface java.lang.Comparable<SearchResultProducer>