KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > search > SubTypeSearchJob


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

11 package org.eclipse.jdt.internal.core.search;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.jdt.core.search.*;
15 import org.eclipse.jdt.internal.compiler.util.SimpleSet;
16 import org.eclipse.jdt.internal.core.index.Index;
17
18 public class SubTypeSearchJob extends PatternSearchJob {
19
20 SimpleSet indexes = new SimpleSet(5);
21
22 public SubTypeSearchJob(SearchPattern pattern, SearchParticipant participant, IJavaSearchScope scope, IndexQueryRequestor requestor) {
23     super(pattern, participant, scope, requestor);
24 }
25 public void finished() {
26     Object JavaDoc[] values = this.indexes.values;
27     for (int i = 0, l = values.length; i < l; i++)
28         if (values[i] != null)
29             ((Index) values[i]).stopQuery();
30 }
31 public boolean search(Index index, IProgressMonitor progressMonitor) {
32     if (index == null) return COMPLETE;
33     if (indexes.addIfNotIncluded(index) == index)
34         index.startQuery();
35     return super.search(index, progressMonitor);
36 }
37 }
38
Popular Tags