1 11 package org.eclipse.jdt.internal.core; 12 13 import org.eclipse.core.resources.IResource; 14 import org.eclipse.core.resources.ResourcesPlugin; 15 import org.eclipse.jdt.core.IClasspathEntry; 16 import org.eclipse.jdt.core.IJavaElement; 17 import org.eclipse.jdt.core.JavaCore; 18 import org.eclipse.jdt.core.JavaModelException; 19 20 public class ExternalJavaProject extends JavaProject { 21 22 25 public static final String EXTERNAL_PROJECT_NAME = " "; 27 public ExternalJavaProject(IClasspathEntry[] rawClasspath) { 28 super(ResourcesPlugin.getWorkspace().getRoot().getProject(EXTERNAL_PROJECT_NAME), JavaModelManager.getJavaModelManager().getJavaModel()); 29 try { 30 getPerProjectInfo().setClasspath(rawClasspath, defaultOutputLocation(), JavaModelStatus.VERIFIED_OK, null, null, null, null); 31 } catch (JavaModelException e) { 32 } 34 } 35 36 public boolean equals(Object o) { 37 return this == o; 38 } 39 40 public boolean exists() { 41 return false; 43 } 44 45 public String getOption(String optionName, boolean inheritJavaCoreOptions) { 46 if (JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE.equals(optionName) 47 || JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE.equals(optionName)) 48 return JavaCore.IGNORE; 49 return super.getOption(optionName, inheritJavaCoreOptions); 50 } 51 52 public boolean isOnClasspath(IJavaElement element) { 53 return false; 55 } 56 57 public boolean isOnClasspath(IResource resource) { 58 return false; 60 } 61 62 } 63 | Popular Tags |