Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.search/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.search; singleton:=true
Bundle-Version: 3.17.300.qualifier
Bundle-Version: 3.17.400.qualifier
Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public interface ISearchPageContainer {
* Sets the selected scope of this search page container. The scope is
* WORKSPACE_SCOPE, SELECTED_PROJECTS_SCOPE, SELECTION_SCOPE,
* OPENED_EDITORS_SCOPE or WORKING_SET_SCOPE.
*
*
* @param scope
* the newly selected scope
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ public static void runQuery(ISearchQuery query) {
if (query == null) {
throw new IllegalArgumentException("query must not be null"); //$NON-NLS-1$
}
if (query.canRunInBackground())
if (query.canRunInBackground()) {
runQueryInBackground(query);
else {
} else {
IStatus status= runQueryInForeground(null, query);
if (status != null) {
if (!status.isOK())
if (!status.isOK()) {
SearchPlugin.log(status);
}
if (status.getSeverity() == IStatus.ERROR) {
ErrorDialog.openError(SearchPlugin.getActiveWorkbenchShell(), SearchMessages.NewSearchUI_error_title, SearchMessages.NewSearchUI_error_label, status);
}
Expand Down Expand Up @@ -131,10 +132,11 @@ public static void runQueryInBackground(ISearchQuery query, ISearchResultViewPar
if (query == null) {
throw new IllegalArgumentException("query must not be null"); //$NON-NLS-1$
}
if (query.canRunInBackground())
if (query.canRunInBackground()) {
InternalSearchUI.getInstance().runSearchInBackground(query, view);
else
} else {
throw new IllegalArgumentException("Query can not be run in background"); //$NON-NLS-1$
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ public Enumeration<Match> getMatchSet(Object element) {
* @param match the match to add
*/
public void addMatch(Match match) {
if (didAddMatch(match))
if (didAddMatch(match)) {
fireChange(getSearchResultEvent(match, MatchEvent.ADDED));
}
}

/**
Expand All @@ -137,8 +138,9 @@ public void addMatches(Match[] matches) {
reallyAdded.add(match);
}
}
if (!reallyAdded.isEmpty())
if (!reallyAdded.isEmpty()) {
fireChange(getSearchResultEvent(reallyAdded, MatchEvent.ADDED));
}
}

private MatchEvent getSearchResultEvent(Match match, int eventKind) {
Expand All @@ -164,8 +166,9 @@ private boolean didAddMatch(Match match) {

private static int compare(Match match2, Match match1) {
int diff= match2.getOffset()-match1.getOffset();
if (diff != 0)
if (diff != 0) {
return diff;
}
return match2.getLength()-match1.getLength();
}

Expand Down Expand Up @@ -193,8 +196,9 @@ private void doRemoveAll() {
* @param match the match to remove
*/
public void removeMatch(Match match) {
if (didRemoveMatch(match))
if (didRemoveMatch(match)) {
fireChange(getSearchResultEvent(match, MatchEvent.REMOVED));
}
}

/**
Expand All @@ -209,11 +213,13 @@ public void removeMatch(Match match) {
public void removeMatches(Match[] matches) {
Collection<Match> existing= new ArrayList<>();
for (Match match : matches) {
if (didRemoveMatch(match))
if (didRemoveMatch(match)) {
existing.add(match); // no duplicate matches at this point
}
}
if (!existing.isEmpty())
if (!existing.isEmpty()) {
fireChange(getSearchResultEvent(existing, MatchEvent.REMOVED));
}
}


Expand Down Expand Up @@ -340,8 +346,9 @@ public int getMatchCount(Object element) {
return 0;
}
Set<Match> matches = fElementsToMatches.get(element);
if (matches != null)
if (matches != null) {
return matches.size();
}
return 0;
}

Expand Down
Loading
Loading