1 11 package org.eclipse.pde.internal.core; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.core.runtime.IPath; 16 import org.eclipse.jdt.core.ClasspathContainerInitializer; 17 import org.eclipse.jdt.core.IClasspathContainer; 18 import org.eclipse.jdt.core.IJavaProject; 19 import org.eclipse.jdt.core.JavaCore; 20 import org.eclipse.pde.core.plugin.IPluginModelBase; 21 import org.eclipse.pde.core.plugin.PluginRegistry; 22 23 public class RequiredPluginsInitializer extends ClasspathContainerInitializer { 24 25 29 public void initialize(IPath containerPath, IJavaProject javaProject) 30 throws CoreException { 31 IProject project = javaProject.getProject(); 32 IPluginModelBase model = PluginRegistry.findModel(project); 33 JavaCore.setClasspathContainer( 34 PDECore.REQUIRED_PLUGINS_CONTAINER_PATH, 35 new IJavaProject[] { javaProject }, 36 new IClasspathContainer[] {new RequiredPluginsClasspathContainer(model)}, 37 null); 38 } 39 40 44 public Object getComparisonID(IPath containerPath, IJavaProject project) { 45 if (containerPath == null || project == null) 46 return null; 47 48 return containerPath.segment(0) + "/" + project.getPath().segment(0); } 50 51 55 public String getDescription(IPath containerPath, IJavaProject project) { 56 return PDECoreMessages.RequiredPluginsClasspathContainer_description; 57 } 58 } 59 | Popular Tags |