Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2011-08-11 19:41:25 +0000
committerFrank Becker2011-08-11 19:41:25 +0000
commit25b889b8d1d916959c2b3a616b58b9d4f570b039 (patch)
tree75672cbc2d93a8ed8299f6c661aa729219708205
parentd061002a450b20b204f31dc808d4d5187624a969 (diff)
parentb4981eb83f3009871db85638a0702d2847db9528 (diff)
downloadorg.eclipse.mylyn.incubator-25b889b8d1d916959c2b3a616b58b9d4f570b039.tar.gz
org.eclipse.mylyn.incubator-25b889b8d1d916959c2b3a616b58b9d4f570b039.tar.xz
org.eclipse.mylyn.incubator-25b889b8d1d916959c2b3a616b58b9d4f570b039.zip
Merge branch 'master' of ssh://fbecker@git.eclipse.org/gitroot/mylyn/org.eclipse.mylyn.incubator.git
-rw-r--r--org.eclipse.mylyn.sandbox.search.ui/plugin.xml1
-rw-r--r--org.eclipse.mylyn.sandbox.search.ui/src/org/eclipse/mylyn/sandbox/search/ui/Search.java46
2 files changed, 46 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.sandbox.search.ui/plugin.xml b/org.eclipse.mylyn.sandbox.search.ui/plugin.xml
index 6b7f9789..4fe3079a 100644
--- a/org.eclipse.mylyn.sandbox.search.ui/plugin.xml
+++ b/org.eclipse.mylyn.sandbox.search.ui/plugin.xml
@@ -26,7 +26,6 @@
point="org.eclipse.ui.commands">
<command
categoryId="org.eclipse.search.ui.category.search"
- defaultHandler="org.eclipse.mylyn.internal.sandbox.search.ui.OpenDesktopSearchHandler"
description="%command.description"
id="org.eclipse.mylyn.internal.sandbox.search.ui.openDesktopSearchCommand"
name="%command.name">
diff --git a/org.eclipse.mylyn.sandbox.search.ui/src/org/eclipse/mylyn/sandbox/search/ui/Search.java b/org.eclipse.mylyn.sandbox.search.ui/src/org/eclipse/mylyn/sandbox/search/ui/Search.java
new file mode 100644
index 00000000..f988484e
--- /dev/null
+++ b/org.eclipse.mylyn.sandbox.search.ui/src/org/eclipse/mylyn/sandbox/search/ui/Search.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies.
+ * 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.sandbox.search.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.mylyn.internal.sandbox.search.ui.DesktopSearchQuery;
+import org.eclipse.mylyn.internal.sandbox.search.ui.SearchProviders;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.NewSearchUI;
+
+/**
+ * API for programatic access to search
+ *
+ * @author David Green
+ * @see NewSearchUI
+ */
+public class Search {
+
+ /**
+ * Create a search query that can be used with {@link NewSearchUI}.
+ *
+ * @param criteria
+ * the search criteria, must not be null
+ * @see NewSearchUI#runQueryInBackground(ISearchQuery)
+ * @see NewSearchUI#runQueryInForeground(org.eclipse.jface.operation.IRunnableContext, ISearchQuery)
+ * @throws CoreException
+ * if the search query cannot be created
+ * @throws IllegalArgumentException
+ * if the given criteria is null
+ */
+ public static ISearchQuery createSearchQuery(SearchCriteria criteria) throws CoreException {
+ if (criteria == null) {
+ throw new IllegalArgumentException();
+ }
+ return new DesktopSearchQuery(SearchProviders.getSearchProvider(), criteria);
+ }
+}

Back to the top