1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist;
13 import net.sourceforge.phpdt.internal.compiler.env.INameEnvironment;
16 * This interface defines the API that may be used to implement any
17 * search-based tool (such as a CodeAssist, a Finder, ...).
18 * It is mainly used to hide from the search tool the implementation
19 * of the underlying environment and its constructions.
21 public interface ISearchableNameEnvironment extends INameEnvironment {
24 * Find the packages that start with the given prefix.
25 * A valid prefix is a qualified name separated by periods
27 * The packages found are passed to:
28 * ISearchRequestor.acceptPackage(char[][] packageName)
30 void findPackages(char[] prefix, ISearchRequestor requestor);
33 * Find the top-level types (classes and interfaces) that are defined
34 * in the current environment and whose name starts with the
35 * given prefix. The prefix is a qualified name separated by periods
36 * or a simple name (ex. java.util.V or V).
38 * The types found are passed to one of the following methods (if additional
39 * information is known about the types):
40 * ISearchRequestor.acceptType(char[][] packageName, char[] typeName)
41 * ISearchRequestor.acceptClass(char[][] packageName, char[] typeName, int modifiers)
42 * ISearchRequestor.acceptInterface(char[][] packageName, char[] typeName, int modifiers)
44 * This method can not be used to find member types... member
45 * types are found relative to their enclosing type.
47 void findTypes(char[] prefix, ISearchRequestor requestor);