/** * Returns a runtime classpath entry for the given container path with the given * classpath property. * * @param path container path * @param classpathProperty the type of entry - one of <code>USER_CLASSES</code>, * <code>BOOTSTRAP_CLASSES</code>, or <code>STANDARD_CLASSES</code> * @return runtime classpath entry * @exception CoreException if unable to construct a runtime classpath entry * @since 2.0 */ public static IRuntimeClasspathEntry newRuntimeContainerClasspathEntry(IPath path, int classpathProperty) throws CoreException { return newRuntimeContainerClasspathEntry(path, classpathProperty, null); }
/** * Returns a runtime classpath entry for the given container path with the given * classpath property. * * @param path container path * @param classpathProperty the type of entry - one of <code>USER_CLASSES</code>, * <code>BOOTSTRAP_CLASSES</code>,<code>STANDARD_CLASSES</code>, <code>MODULE_PATH</code> * or <code>CLASS_PATH</code> * @return runtime classpath entry * @exception CoreException if unable to construct a runtime classpath entry * @since 2.0 */ public static IRuntimeClasspathEntry newRuntimeContainerClasspathEntry(IPath path, int classpathProperty) throws CoreException { return newRuntimeContainerClasspathEntry(path, classpathProperty, null); }
@Override public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] classpath = super.computeUnresolvedClasspath(configuration); final ISREInstall sre = SARLRuntime.getDefaultSREInstall(); if (sre != null) { final IPath containerId = sre.getPreferredClassPathContainerPath(); if (containerId != null && !containerId.equals(SARLClasspathContainerInitializer.CONTAINER_ID)) { final IClasspathEntry library = JavaCore.newContainerEntry(containerId); final IRuntimeClasspathEntry runtimeEntry = JavaRuntime.newRuntimeContainerClasspathEntry( library.getPath(), IRuntimeClasspathEntry.USER_CLASSES); final IRuntimeClasspathEntry[] newClasspath = new IRuntimeClasspathEntry[classpath.length + 1]; System.arraycopy(classpath, 0, newClasspath, 0, classpath.length); newClasspath[classpath.length] = runtimeEntry; classpath = newClasspath; } else { final List<IRuntimeClasspathEntry> entries = sre.getClassPathEntries(); final IRuntimeClasspathEntry[] newClasspath = new IRuntimeClasspathEntry[classpath.length + entries.size()]; System.arraycopy(classpath, 0, newClasspath, 0, classpath.length); final Iterator<IRuntimeClasspathEntry> iterator = entries.iterator(); for (int j = classpath.length; j < newClasspath.length && iterator.hasNext(); ++j) { newClasspath[j] = iterator.next(); } classpath = newClasspath; } } return classpath; }
public static long[] calculateSerialVersionIds(String[] qualifiedNames, IJavaProject project, final IProgressMonitor monitor) throws CoreException, IOException { final String[] entries= computeUserAndBootClasspath(project); final IRuntimeClasspathEntry[] classpath= new IRuntimeClasspathEntry[entries.length + 2]; classpath[0]= JavaRuntime.newRuntimeContainerClasspathEntry(new Path(JavaRuntime.JRE_CONTAINER), IRuntimeClasspathEntry.STANDARD_CLASSES, project); classpath[1]= JavaRuntime.newArchiveRuntimeClasspathEntry(Path.fromOSString(FileLocator.toFileURL(JavaPlugin.getDefault().getBundle().getEntry(SERIAL_SUPPORT_JAR)).getFile())); for (int index= 2; index < classpath.length; index++) classpath[index]= JavaRuntime.newArchiveRuntimeClasspathEntry(Path.fromOSString(entries[index - 2])); return SerialVersionComputationHelper.computeSerialIDs(classpath, project, qualifiedNames, monitor); }
@Override protected ISourceContainer[] createSourceContainers() throws CoreException { IRuntimeClasspathEntry entry = JavaRuntime.newRuntimeContainerClasspathEntry(getPath(), IRuntimeClasspathEntry.USER_CLASSES); IRuntimeClasspathEntry[] entries = JavaRuntime.resolveSourceLookupPath(new IRuntimeClasspathEntry[]{entry}, getDirector().getLaunchConfiguration()); return JavaRuntime.getSourceContainers(entries); }
@Override protected ISourceContainer[] createSourceContainers() throws CoreException { IRuntimeClasspathEntry entry = JavaRuntime.newRuntimeContainerClasspathEntry(getPath(), IRuntimeClasspathEntry.USER_CLASSES); IRuntimeClasspathEntry[] entries = JavaRuntime.resolveSourceLookupPath(new IRuntimeClasspathEntry[]{entry}, getDirector().getLaunchConfiguration()); return JavaRuntime.getSourceContainers(entries); }
/** * Returns a JRE runtime classpath entry * * @param configuration * the launch configuration * @return a JRE runtime classpath entry * @throws CoreException * if the JRE associated with the launch configuration cannot be found * or if unable to retrieve the launch configuration attributes */ private IRuntimeClasspathEntry getJREEntry(ILaunchConfiguration configuration) throws CoreException { IVMInstall jre = VMHelper.createLauncher(configuration); IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER); containerPath = containerPath.append(jre.getVMInstallType().getId()); containerPath = containerPath.append(jre.getName()); return JavaRuntime.newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.BOOTSTRAP_CLASSES); }
classpathEntries.add(newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES, project)); break; case IClasspathContainer.K_SYSTEM: classpathEntries.add(newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, project)); break;
classpathEntries.add(newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES, project)); break; case IClasspathContainer.K_SYSTEM: classpathEntries.add(newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, project)); break;
/** * Prompts for folder(s) to add. * * @see org.eclipse.jface.action.IAction#run() */ public void run() { IClasspathEntry[] newEntries = BuildPathDialogAccess.chooseContainerEntries(getShell(), null, new IClasspathEntry[0]); if (newEntries != null) { IRuntimeClasspathEntry[] res= new IRuntimeClasspathEntry[newEntries.length]; for (int i = 0; i < newEntries.length; i++) { IClasspathEntry entry = newEntries[i]; try { res[i] = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES); } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(LauncherMessages.RuntimeClasspathAdvancedDialog_Unable_to_create_new_entry__3, e.getStatus()); return; } } getViewer().addEntries(res); } }
classpathEntries.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.USER_CLASSES, project)); break;
final IRuntimeClasspathEntry bootEntry = JavaRuntime.newRuntimeContainerClasspathEntry( jreEntry.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES,
case IClasspathContainer.K_DEFAULT_SYSTEM: if (isModularProject(project)) { return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.MODULE_PATH); return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.CLASS_PATH); case IClasspathContainer.K_SYSTEM: if (isModularProject(project)) { return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.MODULE_PATH); return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.CLASS_PATH);
return newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.MODULE_PATH); return newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
break; case IClasspathContainer.K_DEFAULT_SYSTEM: return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES); case IClasspathContainer.K_SYSTEM: return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
break; case IClasspathContainer.K_DEFAULT_SYSTEM: return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES); case IClasspathContainer.K_SYSTEM: return newRuntimeContainerClasspathEntry(entry.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
break; rte = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), kind, proj); break; case IClasspathEntry.CPE_LIBRARY:
break; rte = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), kind, proj); break; case IClasspathEntry.CPE_LIBRARY:
break; rte = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), kind, proj); break; case IClasspathEntry.CPE_LIBRARY:
return newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.STANDARD_CLASSES);