1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 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.corext.codemanipulation; 12 13 public interface IImportsStructure { 14 15 /** 16 * Adds a new import declaration that is sorted in the structure using 17 * a best match algorithm. If an import already exists, the import is 18 * not added. An import is also not added if its container is 'java.lang' or the 19 * same package as the compilation unit. 20 * @param qualifiedTypeName The fully qualified name of the type to import 21 * (dot separated) 22 * @return Retuns the simple type name that can be used in the code or the 23 * fully qualified type name if an import conflict prevented the import. 24 */ 25 String addImport(String qualifiedTypeName); 26 27 /** 28 * Adds a new import declaration that is sorted in the structure using 29 * a best match algorithm. If an import already exists, the import is 30 * not added. An import is also not added if its container is 'java.lang' or the 31 * same package as the compilation unit. 32 * @param qualifiedTypeName The fully qualified name of the type to import 33 * (dot separated) 34 * @return Retuns the simple type name that can be used in the code or the 35 * fully qualified type name if an import conflict prevented the import. 36 */ 37 String addStaticImport(String qualifiedTypeName, String selector, boolean isField); 38 39 40 } 41