01: /*******************************************************************************
02: * Copyright (c) 2003 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jsp;
11:
12: import org.eclipse.core.indexsearch.IIndexQuery;
13: import org.eclipse.core.indexsearch.ISearchResultCollector;
14: import org.eclipse.core.resources.IResource;
15: import org.eclipse.core.runtime.CoreException;
16: import org.eclipse.core.runtime.IProgressMonitor;
17: import org.eclipse.jdt.core.search.IJavaSearchResultCollector;
18:
19: public class JspSearchEngine {
20:
21: public static void search(
22: final IJavaSearchResultCollector collector,
23: final IIndexQuery query, IProgressMonitor pm) {
24:
25: System.out.println("JspSearchEngine.search: " + query); //$NON-NLS-1$
26:
27: JspUIPlugin.getDefault().search(query,
28: new ISearchResultCollector() {
29: public void accept(IResource resource, int start,
30: int length) throws CoreException {
31: System.out.println(" accept: " + resource); //$NON-NLS-1$
32: collector.accept(resource, start, start
33: + length, null, 999);
34: }
35: }, pm);
36: }
37: }
|