Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-04-02 20:37:07 -0400
committerspingel2010-04-02 20:37:07 -0400
commit303067bc98d9d6057d5f42de91331c6a24fb981b (patch)
treeb420eba38eac28ce8d10d2bb182ea27ea5b98805 /org.eclipse.mylyn.tasks.search
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')
-rw-r--r--org.eclipse.mylyn.tasks.search/.classpath2
-rw-r--r--org.eclipse.mylyn.tasks.search/plugin.xml7
-rw-r--r--org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/DefaultSearchProvider.java45
3 files changed, 53 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.search/.classpath b/org.eclipse.mylyn.tasks.search/.classpath
index 59d3d34a5..60082e5df 100644
--- a/org.eclipse.mylyn.tasks.search/.classpath
+++ b/org.eclipse.mylyn.tasks.search/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/mylyn/internal/provisional/**"/>
+ <accessrule kind="accessible" pattern="org/eclipse/mylyn/internal/**"/>
<accessrule kind="accessible" pattern="org/eclipse/search/internal/ui/**"/>
<accessrule kind="accessible" pattern="org/eclipse/ui/search/internal/*"/>
<accessrule kind="accessible" pattern="org/eclipse/ui/internal/**"/>
diff --git a/org.eclipse.mylyn.tasks.search/plugin.xml b/org.eclipse.mylyn.tasks.search/plugin.xml
index 7b315a61f..ef5fe5419 100644
--- a/org.eclipse.mylyn.tasks.search/plugin.xml
+++ b/org.eclipse.mylyn.tasks.search/plugin.xml
@@ -61,4 +61,11 @@
</adapter>
</factory>
</extension>
+ <extension
+ point="org.eclipse.mylyn.tasks.ui.searchProvider">
+ <searchProvider
+ class="org.eclipse.mylyn.internal.tasks.ui.search.DefaultSearchProvider"
+ id="org.eclipse.mylyn.tasks.search.searchProvider">
+ </searchProvider>
+ </extension>
</plugin>
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