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 Details

    • SearchResult

      public SearchResult(org.eclipse.search.ui.ISearchQuery searchQuery)
      Create instance of SearchResult
      Parameters:
      searchQuery - for which the result will be calculated, cannot be null
  • Method Details

    • addListener

      public void addListener(org.eclipse.search.ui.ISearchResultListener listener)
      Specified by:
      addListener in interface org.eclipse.search.ui.ISearchResult
    • removeListener

      public void removeListener(org.eclipse.search.ui.ISearchResultListener listener)
      Specified by:
      removeListener in interface org.eclipse.search.ui.ISearchResult
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface org.eclipse.search.ui.ISearchResult
    • getTooltip

      public String getTooltip()
      Specified by:
      getTooltip in interface org.eclipse.search.ui.ISearchResult
    • getImageDescriptor

      public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
      Specified by:
      getImageDescriptor in interface org.eclipse.search.ui.ISearchResult
    • getQuery

      public org.eclipse.search.ui.ISearchQuery getQuery()
      Specified by:
      getQuery in interface org.eclipse.search.ui.ISearchResult
    • addMatch

      public void addMatch(Match match)
      Description copied from interface: ISearchResultCollector
      Adds a Match to this search result. This method does nothing if the match is already present.
      Specified by:
      addMatch in interface ISearchResultCollector
      Parameters:
      match - the match to add, cannot be null
    • addMatches

      public void addMatches(Collection<Match> matches)
      Description copied from interface: ISearchResultCollector
      Adds a number of Matches to this search result. This method does nothing for matches that are already present.
      Specified by:
      addMatches in interface ISearchResultCollector
      Parameters:
      matches - the matches to add, cannot be null
    • removeMatche

      public void removeMatche(Match match)
      Removes a Match from this search result. This method does nothing if the match has no in present.
      Parameters:
      match - the match to remove, cannot be null
    • removeMatches

      public void removeMatches(Collection<Match> matches)
      Removes a number of Matches from this search result. This method does nothing if the matches has no in present.
      Parameters:
      matches - the matches to remove, cannot be null
    • 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

      public Collection<Match> getMatches(Object element)
      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, or false in otherwise
    • getElements

      public Collection<Object> 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

      public void addMatchFilter(IMatchFilter filter)
      Adds registered match filter and notifies listeners
      Parameters:
      filter - the match filter, cannot be null
    • removeMatchFilter

      public void removeMatchFilter(String filterId, boolean update)
      Removes early registered match filter and notifies listeners
      Parameters:
      filter - the string of match filter id, cannot be null
      update - true for notify listeners if filter will removed, and false in otherwise
    • removeMatchFilter

      public void removeMatchFilter(IMatchFilter filter)
      Removes early registered match filter and notifies listeners
      Parameters:
      filter - the match filter, cannot be null
    • getMatchFilters

      public Set<IMatchFilter> getMatchFilters()
      Get all registered match filters
      Returns:
      the set of registered match filters