private void setClasspath(IProject project, IFeatureModel model, IProgressMonitor monitor) throws JavaModelException { IJavaProject jProject = JavaCore.create(project); IClasspathEntry jreCPEntry = JavaCore.newContainerEntry( new Path("org.eclipse.jdt.launching.JRE_CONTAINER")); // $NON-NLS-1$ String libName = model.getFeature().getInstallHandler().getLibrary(); IClasspathEntry handlerCPEntry = JavaCore.newLibraryEntry(project.getFullPath().append(libName), null, null); jProject.setRawClasspath(new IClasspathEntry[] {jreCPEntry, handlerCPEntry}, monitor); }
private void addProjectSourceContainers(IProject project, ArrayList result) throws CoreException { if (project == null || !project.hasNature(JavaCore.NATURE_ID)) return; IJavaProject jProject = JavaCore.create(project); result.add(JavaRuntime.newProjectRuntimeClasspathEntry(jProject)); IClasspathEntry[] entries = jProject.getRawClasspath(); for (int i = 0; i < entries.length; i++) { IClasspathEntry entry = entries[i]; if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { IRuntimeClasspathEntry rte = convertClasspathEntry(entry); if (rte != null) result.add(rte); } } }