1 /* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Eclipse Public License, Version 1.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.eclipse.org/org/documents/epl-v10.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ide.eclipse.adt.internal.project; 18 19 import org.eclipse.core.runtime.IPath; 20 import org.eclipse.jdt.core.IClasspathContainer; 21 import org.eclipse.jdt.core.IClasspathEntry; 22 23 /** 24 * Classpath container for the Android projects. 25 * This supports both the System classpath and the library dependencies. 26 */ 27 class AndroidClasspathContainer implements IClasspathContainer { 28 29 private final IClasspathEntry[] mClasspathEntry; 30 private final IPath mContainerPath; 31 private final String mName; 32 private final int mKind; 33 34 /** 35 * Constructs the container with the {@link IClasspathEntry} representing the android 36 * framework jar file and the container id 37 * @param entries the entries representing the android framework and optional libraries. 38 * @param path the path containing the classpath container id. 39 * @param name the name of the container to display. 40 * @param the container kind. Can be {@link IClasspathContainer#K_DEFAULT_SYSTEM} or 41 * {@link IClasspathContainer#K_APPLICATION} 42 */ AndroidClasspathContainer(IClasspathEntry[] entries, IPath path, String name, int kind)43 AndroidClasspathContainer(IClasspathEntry[] entries, IPath path, String name, int kind) { 44 mClasspathEntry = entries; 45 mContainerPath = path; 46 mName = name; 47 mKind = kind; 48 } 49 50 @Override getClasspathEntries()51 public IClasspathEntry[] getClasspathEntries() { 52 return mClasspathEntry; 53 } 54 55 @Override getDescription()56 public String getDescription() { 57 return mName; 58 } 59 60 @Override getKind()61 public int getKind() { 62 return mKind; 63 } 64 65 @Override getPath()66 public IPath getPath() { 67 return mContainerPath; 68 } 69 } 70