public class ModelSearchResult
extends java.lang.Object
implements org.eclipse.search.ui.ISearchResult
Constructor and Description |
---|
ModelSearchResult(ModelSearchQuery query) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(org.eclipse.search.ui.ISearchResultListener searchResultListener) |
void |
addMatch(ModelSearchMatch match)
Adds a
Match to this search result. |
void |
addMatches(ModelSearchMatch[] matches)
Adds a number of SearchMatches to this search result.
|
protected void |
fireChange(org.eclipse.search.ui.SearchResultEvent e)
Send the given
SearchResultEvent to all registered search result listeners. |
java.lang.Object[] |
getElements()
Returns an array containing the set of all elements that matches are reported against in this search result.
|
org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor() |
java.lang.String |
getLabel() |
int |
getMatchCount()
Returns the total number of matches contained in this search result.
|
int |
getMatchCount(java.lang.Object element)
Returns the number of matches reported against a given element.
|
ModelSearchMatch[] |
getMatches(java.lang.Object element)
Returns an array with all matches reported against the given element.
|
org.eclipse.search.ui.ISearchQuery |
getQuery() |
java.lang.String |
getTooltip() |
void |
removeAll()
Removes all matches from this search result.
|
void |
removeListener(org.eclipse.search.ui.ISearchResultListener searchResultListener) |
void |
removeMatch(ModelSearchMatch match)
Removes the given match from this search result.
|
void |
removeMatches(ModelSearchMatch[] matches)
Removes the given matches from this search result.
|
public ModelSearchResult(ModelSearchQuery query)
public ModelSearchMatch[] getMatches(java.lang.Object element)
element
- the element to report matches forModelSearchMatch.getElement()
public void addMatch(ModelSearchMatch match)
Match
to this search result. This method does nothing if the match is already present.
Subclasses may extend this method.
match
- the match to addpublic void addMatches(ModelSearchMatch[] matches)
Subclasses may extend this method.
matches
- the matches to addpublic java.lang.Object[] getElements()
public void removeAll()
Subclasses may extend this method.
public void removeMatch(ModelSearchMatch match)
Subclasses may extend this method.
match
- the match to removepublic void removeMatches(ModelSearchMatch[] matches)
Subclasses may extend this method.
matches
- the matches to removeprotected void fireChange(org.eclipse.search.ui.SearchResultEvent e)
SearchResultEvent
to all registered search result listeners.e
- the event to be sentISearchResultListener
public void addListener(org.eclipse.search.ui.ISearchResultListener searchResultListener)
addListener
in interface org.eclipse.search.ui.ISearchResult
public void removeListener(org.eclipse.search.ui.ISearchResultListener searchResultListener)
removeListener
in interface org.eclipse.search.ui.ISearchResult
public java.lang.String getLabel()
getLabel
in interface org.eclipse.search.ui.ISearchResult
public java.lang.String getTooltip()
getTooltip
in interface org.eclipse.search.ui.ISearchResult
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
getImageDescriptor
in interface org.eclipse.search.ui.ISearchResult
public org.eclipse.search.ui.ISearchQuery getQuery()
getQuery
in interface org.eclipse.search.ui.ISearchResult
public int getMatchCount()
public int getMatchCount(java.lang.Object element)
getMatches(element).length
The filter state of the matches is not relevant when counting matches.
All matches are counted.element
- the element to get the match count for