Class SearchResult
java.lang.Object
com._1c.g5.v8.dt.internal.search.ui.SearchResult
- All Implemented Interfaces:
ISearchResultCollector
,org.eclipse.search.ui.ISearchResult
public class SearchResult
extends Object
implements ISearchResultCollector, org.eclipse.search.ui.ISearchResult
Represent the result of a search to UI search view
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResult
(org.eclipse.search.ui.ISearchQuery searchQuery) Create instance ofSearchResult
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(org.eclipse.search.ui.ISearchResultListener listener) void
Adds aMatch
to this search result.void
addMatches
(Collection<Match> matches) Adds a number ofMatch
es to this search result.void
addMatchFilter
(IMatchFilter filter) Adds registered match filter and notifies listenersvoid
finish()
Notify listeners search finishlong
Returns the number of displayed matches contained in this search result.Get all match groups in search resultorg.eclipse.jface.resource.ImageDescriptor
getLabel()
long
Returns the total number of matches contained in this search result.getMatches
(Object element) Returns an collection with all matches reported against the given element.Get all registered match filtersorg.eclipse.search.ui.ISearchQuery
getQuery()
boolean
isEmpty()
Check result is empty, no any matches at nowvoid
removeListener
(org.eclipse.search.ui.ISearchResultListener listener) void
removeMatche
(Match match) Removes aMatch
from this search result.void
removeMatches
(Collection<Match> matches) Removes a number ofMatch
es from this search result.void
removeMatchFilter
(IMatchFilter filter) Removes early registered match filter and notifies listenersvoid
removeMatchFilter
(String filterId, boolean update) Removes early registered match filter and notifies listenersvoid
reset()
Reset search result.
-
Constructor Details
-
SearchResult
public SearchResult(org.eclipse.search.ui.ISearchQuery searchQuery) Create instance ofSearchResult
- Parameters:
searchQuery
- for which the result will be calculated, cannot benull
-
-
Method Details
-
addListener
public void addListener(org.eclipse.search.ui.ISearchResultListener listener) - Specified by:
addListener
in interfaceorg.eclipse.search.ui.ISearchResult
-
removeListener
public void removeListener(org.eclipse.search.ui.ISearchResultListener listener) - Specified by:
removeListener
in interfaceorg.eclipse.search.ui.ISearchResult
-
getLabel
- Specified by:
getLabel
in interfaceorg.eclipse.search.ui.ISearchResult
-
getTooltip
- Specified by:
getTooltip
in interfaceorg.eclipse.search.ui.ISearchResult
-
getImageDescriptor
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()- Specified by:
getImageDescriptor
in interfaceorg.eclipse.search.ui.ISearchResult
-
getQuery
public org.eclipse.search.ui.ISearchQuery getQuery()- Specified by:
getQuery
in interfaceorg.eclipse.search.ui.ISearchResult
-
addMatch
Description copied from interface:ISearchResultCollector
Adds aMatch
to this search result. This method does nothing if the match is already present.- Specified by:
addMatch
in interfaceISearchResultCollector
- Parameters:
match
- the match to add, cannot benull
-
addMatches
Description copied from interface:ISearchResultCollector
Adds a number ofMatch
es to this search result. This method does nothing for matches that are already present.- Specified by:
addMatches
in interfaceISearchResultCollector
- Parameters:
matches
- the matches to add, cannot benull
-
removeMatche
Removes aMatch
from this search result. This method does nothing if the match has no in present.- Parameters:
match
- the match to remove, cannot benull
-
removeMatches
Removes a number ofMatch
es from this search result. This method does nothing if the matches has no in present.- Parameters:
matches
- the matches to remove, cannot benull
-
reset
public void reset()Reset search result. Releace all matches references and notify listeners about reset -
finish
public void finish()Notify listeners search finish -
getMatches
Returns an collection with all matches reported against the given element. Note that all matches of the given element are returned. The filter state of the matches is not relevant.- Parameters:
element
- the element to report matches for- Returns:
- all matches reported for this element
- See Also:
-
isEmpty
public boolean isEmpty()Check result is empty, no any matches at now- Returns:
true
if no any matches in result, orfalse
in otherwise
-
getElements
Get all match groups in search result- Returns:
- list of match groups in search result, cannot be
null
-
getMatchCount
public long getMatchCount()Returns the total number of matches contained in this search result. The filter state of the matches is not relevant when counting matches. All matches are counted.- Returns:
- total number of matches
-
getDisplayedMatchCount
public long getDisplayedMatchCount()Returns the number of displayed matches contained in this search result. Only not filtred matches are counted.- Returns:
- number of displayed matches
-
addMatchFilter
Adds registered match filter and notifies listeners- Parameters:
filter
- the match filter, cannot benull
-
removeMatchFilter
Removes early registered match filter and notifies listeners- Parameters:
filter
- the string of match filter id, cannot benull
update
-true
for notify listeners if filter will removed, andfalse
in otherwise
-
removeMatchFilter
Removes early registered match filter and notifies listeners- Parameters:
filter
- the match filter, cannot benull
-
getMatchFilters
Get all registered match filters- Returns:
- the set of registered match filters
-