| 1 | /******************************************************************************* | 
| 2 |  * Copyright (c) 2008, 2009 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.pde.api.tools.internal; | 
| 12 |   | 
| 13 | import org.eclipse.jdt.core.IJavaProject; | 
| 14 | import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor; | 
| 15 |   | 
| 16 | /** | 
| 17 |  * An API description for a project that does not have an API tooling nature. | 
| 18 |  * Keeps track of package visibility. | 
| 19 |  *  | 
| 20 |  * @since 1.1 | 
| 21 |  */ | 
| 22 | public class NonApiProjectDescription extends ProjectApiDescription { | 
| 23 |   | 
| 24 |         /** | 
| 25 |          * Constructs API description for the given project. | 
| 26 |          *  | 
| 27 |          * @param project | 
| 28 |          */ | 
| 29 |         public NonApiProjectDescription(IJavaProject project) { | 
| 30 |                 super(project); | 
| 31 |         } | 
| 32 |   | 
| 33 |         /* | 
| 34 |          * (non-Javadoc) | 
| 35 |          *  | 
| 36 |          * @see org.eclipse.pde.api.tools.internal.model.ProjectApiDescription#isInsertOnResolve(org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor) | 
| 37 |          */ | 
| 38 |         protected boolean isInsertOnResolve(IElementDescriptor elementDescriptor) { | 
| 39 |                 switch (elementDescriptor.getElementType()) { | 
| 40 |                         case IElementDescriptor.PACKAGE: | 
| 41 |                                 return true; | 
| 42 |                         default: | 
| 43 |                                 return false; | 
| 44 |                 } | 
| 45 |         } | 
| 46 |   | 
| 47 | } |