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 TypeMethodDescriptionvoidaddListener(org.eclipse.search.ui.ISearchResultListener listener) voidAdds aMatchto this search result.voidaddMatches(Collection<Match> matches) Adds a number ofMatches to this search result.voidaddMatchFilter(IMatchFilter filter) Adds registered match filter and notifies listenersvoidfinish()Notify listeners search finishlongReturns the number of displayed matches contained in this search result.Get all match groups in search resultorg.eclipse.jface.resource.ImageDescriptorgetLabel()longReturns 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.ISearchQuerygetQuery()booleanisEmpty()Check result is empty, no any matches at nowvoidremoveListener(org.eclipse.search.ui.ISearchResultListener listener) voidremoveMatche(Match match) Removes aMatchfrom this search result.voidremoveMatches(Collection<Match> matches) Removes a number ofMatches from this search result.voidremoveMatchFilter(IMatchFilter filter) Removes early registered match filter and notifies listenersvoidremoveMatchFilter(String filterId, boolean update) Removes early registered match filter and notifies listenersvoidreset()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:
addListenerin interfaceorg.eclipse.search.ui.ISearchResult
-
removeListener
public void removeListener(org.eclipse.search.ui.ISearchResultListener listener) - Specified by:
removeListenerin interfaceorg.eclipse.search.ui.ISearchResult
-
getLabel
- Specified by:
getLabelin interfaceorg.eclipse.search.ui.ISearchResult
-
getTooltip
- Specified by:
getTooltipin interfaceorg.eclipse.search.ui.ISearchResult
-
getImageDescriptor
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()- Specified by:
getImageDescriptorin interfaceorg.eclipse.search.ui.ISearchResult
-
getQuery
public org.eclipse.search.ui.ISearchQuery getQuery()- Specified by:
getQueryin interfaceorg.eclipse.search.ui.ISearchResult
-
addMatch
Description copied from interface:ISearchResultCollectorAdds aMatchto this search result. This method does nothing if the match is already present.- Specified by:
addMatchin interfaceISearchResultCollector- Parameters:
match- the match to add, cannot benull
-
addMatches
Description copied from interface:ISearchResultCollectorAdds a number ofMatches to this search result. This method does nothing for matches that are already present.- Specified by:
addMatchesin interfaceISearchResultCollector- Parameters:
matches- the matches to add, cannot benull
-
removeMatche
Removes aMatchfrom 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 ofMatches 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:
trueif no any matches in result, orfalsein 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 benullupdate-truefor notify listeners if filter will removed, andfalsein 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
-