Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-04-03 00:37:07 +0000
committerspingel2010-04-03 00:37:07 +0000
commit303067bc98d9d6057d5f42de91331c6a24fb981b (patch)
treeb420eba38eac28ce8d10d2bb182ea27ea5b98805 /org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui
parent89cfdaaa835d5b420bbccb04a23cd5f91016ff60 (diff)
downloadorg.eclipse.mylyn.tasks-303067bc98d9d6057d5f42de91331c6a24fb981b.tar.gz
org.eclipse.mylyn.tasks-303067bc98d9d6057d5f42de91331c6a24fb981b.tar.xz
org.eclipse.mylyn.tasks-303067bc98d9d6057d5f42de91331c6a24fb981b.zip
NEW - bug 304099: [patch][api] create extension point for tasks related search functionality
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304099
Diffstat (limited to 'org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui')
-rw-r--r--org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/DefaultSearchProvider.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/DefaultSearchProvider.java b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/DefaultSearchProvider.java
new file mode 100644
index 000000000..ef9cfb3da
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/DefaultSearchProvider.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Flavio Donze and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Flavio Donze - initial API and implementation
+ * Tasktop Technologies - improvements
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.search;
+
+import org.eclipse.mylyn.internal.tasks.core.ITaskList;
+import org.eclipse.mylyn.internal.tasks.ui.TaskSearchPage;
+import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This search provider uses the default platform search functionality.
+ *
+ * @author Flavio Donze
+ */
+public class DefaultSearchProvider extends AbstractSearchProvider {
+
+ @Override
+ public void openSearchDialog(IWorkbenchWindow window) {
+ NewSearchUI.openSearchDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), TaskSearchPage.ID);
+ }
+
+ @Override
+ public void runSearchQuery(ITaskList tasklist, TaskRepository repository, IRepositoryQuery repositoryQuery,
+ boolean activateResultView) {
+ if (activateResultView) {
+ NewSearchUI.activateSearchResultView();
+ }
+ SearchHitCollector collector = new SearchHitCollector(tasklist, repository, repositoryQuery);
+ NewSearchUI.runQueryInBackground(collector);
+ }
+
+}

Back to the top