KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > internal > core > text > FileMatchCollector


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.search.internal.core.text;
12
13 import java.lang.reflect.InvocationTargetException JavaDoc;
14
15 import org.eclipse.core.resources.IResourceProxy;
16 import org.eclipse.core.runtime.CoreException;
17
18 /**
19  * @author Thomas Mäder
20  *
21  */

22 public class FileMatchCollector implements IMatchCollector {
23     private ITextSearchResultCollector fCollector;
24     private IResourceProxy fProxy;
25     
26     public FileMatchCollector(ITextSearchResultCollector collector, IResourceProxy proxy) {
27         fCollector= collector;
28         fProxy= proxy;
29     }
30
31     public void accept(String JavaDoc line, int start, int length, int lineNumber) throws InvocationTargetException JavaDoc {
32         try {
33             fCollector.accept(fProxy, line, start, length, lineNumber);
34         } catch (CoreException e) {
35             throw new InvocationTargetException JavaDoc(e);
36         }
37     }
38 }
39
Popular Tags