Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-04-02 21:33:20 -0400
committerspingel2010-04-02 21:33:20 -0400
commitac04a12c6f57645283593918e5f0f47dad4ea44e (patch)
tree1f42c4b4f3073e8ee63d83bd9dc3ebe3c8f5bd06 /org.eclipse.mylyn.tasks.search
parent3a236a4458dd45d54e3243943c67f286a74da59b (diff)
downloadorg.eclipse.mylyn.tasks-ac04a12c6f57645283593918e5f0f47dad4ea44e.tar.gz
org.eclipse.mylyn.tasks-ac04a12c6f57645283593918e5f0f47dad4ea44e.tar.xz
org.eclipse.mylyn.tasks-ac04a12c6f57645283593918e5f0f47dad4ea44e.zip
NEW - bug 305075: [patch] consume search extension point
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305075
Diffstat (limited to 'org.eclipse.mylyn.tasks.search')
-rw-r--r--org.eclipse.mylyn.tasks.search/plugin.xml17
-rw-r--r--org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java3
-rw-r--r--org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchTaskHandler.java37
3 files changed, 53 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.search/plugin.xml b/org.eclipse.mylyn.tasks.search/plugin.xml
index ef5fe5419..dd469383e 100644
--- a/org.eclipse.mylyn.tasks.search/plugin.xml
+++ b/org.eclipse.mylyn.tasks.search/plugin.xml
@@ -27,7 +27,7 @@
icon="icons/eview16/task-search.gif"
id="org.eclipse.mylyn.tasks.ui.search.open"
label="%OpenTaskSearchAction.label"
- menubarPath="tasks">
+ menubarPath="search">
</action>
</viewContribution>
</extension>
@@ -68,4 +68,19 @@
id="org.eclipse.mylyn.tasks.search.searchProvider">
</searchProvider>
</extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.ui.category.navigate"
+ defaultHandler="org.eclipse.mylyn.internal.tasks.ui.search.SearchTaskHandler"
+ id="org.eclipse.mylyn.tasks.ui.command.searchForTask"
+ name="%command.searchForTask.name"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.mylyn.tasks.ui.command.searchForTask"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+F12"/>
+ </extension>
</plugin>
diff --git a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java
index 4f1b0a3b9..06050c204 100644
--- a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java
+++ b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java
@@ -545,11 +545,8 @@ public class TaskSearchPage extends DialogPage implements ISearchPage {
private class DeadSearchPage extends AbstractRepositoryQueryPage {
- private final Status status;
-
public DeadSearchPage(TaskRepository rep, Status status) {
super("Search page error", rep); //$NON-NLS-1$
- this.status = status;
}
public void createControl(Composite parent) {
diff --git a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchTaskHandler.java b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchTaskHandler.java
new file mode 100644
index 000000000..ee3ed888c
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchTaskHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.search;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.mylyn.internal.tasks.ui.TaskSearchPage;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * A command handler that opens the task search dialog.
+ *
+ * @author Steffen Pingel
+ */
+public class SearchTaskHandler extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
+ if (window != null) {
+ NewSearchUI.openSearchDialog(window, TaskSearchPage.ID);
+ }
+ return null;
+ }
+
+}

Back to the top