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.jdt.internal.codeassist; 12 13 import org.eclipse.jdt.internal.compiler.env.INameEnvironment; 14 15 /** 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. 20 */ 21 public interface ISearchableNameEnvironment extends INameEnvironment { 22 23 /** 24 * Find the packages that start with the given prefix. 25 * A valid prefix is a qualified name separated by periods 26 * (ex. java.util). 27 * The packages found are passed to: 28 * ISearchRequestor.acceptPackage(char[][] packageName) 29 */ 30 void findPackages(char[] prefix, ISearchRequestor requestor); 31 32 /** 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). 37 * 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) 43 * 44 * This method can not be used to find member types... member 45 * types are found relative to their enclosing type. 46 */ 47 void findTypes(char[] prefix, ISearchRequestor requestor); 48 } 49