/** * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) */ @Override public String getDescription(IPath containerPath, IJavaProject project) { String tag = getExecutionEnvironmentId(containerPath); if (tag == null && containerPath.segmentCount() > 2) { tag = getVMName(containerPath); } if (tag != null) { return NLS.bind(LaunchingMessages.JREContainer_JRE_System_Library_1, new String[]{tag}); } return LaunchingMessages.JREContainerInitializer_Default_System_Library_1; } }
/** * Returns the identifier of the VM install type referenced by the * given JRE classpath container path, or <code>null</code> if none. * * @param jreContainerPath the path to the container to try and resolve the {@link IVMInstallType} id from * @return VM install type identifier or <code>null</code> * @since 3.2 */ public static String getVMInstallTypeId(IPath jreContainerPath) { if (JREContainerInitializer.isExecutionEnvironment(jreContainerPath)) { return null; } return JREContainerInitializer.getVMTypeId(jreContainerPath); }
/** * Returns the JRE referenced by the specified JRE classpath container * path or <code>null</code> if none. * * @param jreContainerPath the path to the container to try and resolve the {@link IVMInstall} from * @return JRE referenced by the specified JRE classpath container * path or <code>null</code> * @since 3.2 */ public static IVMInstall getVMInstall(IPath jreContainerPath) { return JREContainerInitializer.resolveVM(jreContainerPath); }
/** * Returns the name of the VM install referenced by the * given JRE classpath container path, or <code>null</code> if none. * * @param jreContainerPath the path to the container to try an resolve the {@link IVMInstall} name from * @return VM name or <code>null</code> * @since 3.2 */ public static String getVMInstallName(IPath jreContainerPath) { if (JREContainerInitializer.isExecutionEnvironment(jreContainerPath)) { return null; } return JREContainerInitializer.getVMName(jreContainerPath); }
if (containerPath.segmentCount() > 1) { String id = getExecutionEnvironmentId(containerPath); if (id != null) { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { IExecutionEnvironment environment = manager.getEnvironment(id); if (environment != null) { vm = resolveVM(environment); } else { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { String vmTypeId = getVMTypeId(containerPath); String vmName = getVMName(containerPath); IVMInstallType vmType = JavaRuntime.getVMInstallType(vmTypeId); if (vmType != null) {
/** * Returns the segment from the path containing the execution environment id * or <code>null</code> * * @param path container path * @return EE id */ public static String getExecutionEnvironmentId(IPath path) { String name = getVMName(path); if (name != null) { name = decodeEnvironmentId(name); IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager(); IExecutionEnvironment environment = manager.getEnvironment(name); if (environment != null) { return environment.getId(); } } return null; }
@Override public void buildFinished(IJavaProject project) { super.buildFinished(project); if (fCleaned.remove(project)) { String eeId = null; IPath container = null; try { IClasspathEntry[] rawClasspath = project.getRawClasspath(); for (int j = 0; j < rawClasspath.length; j++) { IClasspathEntry entry = rawClasspath[j]; if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path = entry.getPath(); if (JavaRuntime.JRE_CONTAINER.equals(path.segment(0))) { container = path; eeId = JREContainerInitializer.getExecutionEnvironmentId(path); } } } } catch (CoreException e) { LaunchingPlugin.log(e); } if (container != null && eeId != null) { IVMInstall vm = JREContainerInitializer.resolveVM(container); validateEnvironment(eeId, project, vm); } } }
projectsList.toArray(referenceProjects); JREContainerInitializer initializer = new JREContainerInitializer(); initializer.initialize(reference, referenceProjects);
/** * Returns whether the given path identifies a VM by execution environment. * * @param path the path * @return whether the given path identifies a VM by execution environment */ public static boolean isExecutionEnvironment(IPath path) { return getExecutionEnvironmentId(path) != null; }
/** * Returns a path for the JRE classpath container identifying the * specified execution environment. * * @param environment execution environment * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(IExecutionEnvironment environment) { IPath path = newDefaultJREContainerPath(); path = path.append(StandardVMType.ID_STANDARD_VM_TYPE); path = path.append(JREContainerInitializer.encodeEnvironmentId(environment.getId())); return path; }
if (containerPath.segmentCount() > 1) { String id = getExecutionEnvironmentId(containerPath); if (id != null) { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { IExecutionEnvironment environment = manager.getEnvironment(id); if (environment != null) { vm = resolveVM(environment); } else { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { String vmTypeId = getVMTypeId(containerPath); String vmName = getVMName(containerPath); IVMInstallType vmType = JavaRuntime.getVMInstallType(vmTypeId); if (vmType != null) {
/** * Returns the name of the VM install referenced by the * given JRE classpath container path, or <code>null</code> if none. * * @param jreContainerPath the path to the container to try an resolve the {@link IVMInstall} name from * @return VM name or <code>null</code> * @since 3.2 */ public static String getVMInstallName(IPath jreContainerPath) { if (JREContainerInitializer.isExecutionEnvironment(jreContainerPath)) { return null; } return JREContainerInitializer.getVMName(jreContainerPath); }
/** * Returns the segment from the path containing the execution environment id * or <code>null</code> * * @param path container path * @return EE id */ public static String getExecutionEnvironmentId(IPath path) { String name = getVMName(path); if (name != null) { name = decodeEnvironmentId(name); IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager(); IExecutionEnvironment environment = manager.getEnvironment(name); if (environment != null) { return environment.getId(); } } return null; }
if (JavaRuntime.JRE_CONTAINER.equals(path.segment(0))) { container = path; eeId = JREContainerInitializer.getExecutionEnvironmentId(path); IVMInstall vm = JREContainerInitializer.resolveVM(container); validateEnvironment(eeId, project, vm); if (vm instanceof IVMInstall2) { IVMInstall vm = JREContainerInitializer.resolveVM(container); if (vm instanceof IVMInstall2) { eeId = getCompilerCompliance((IVMInstall2) vm);
projectsList.toArray(referenceProjects); JREContainerInitializer initializer = new JREContainerInitializer(); initializer.initialize(reference, referenceProjects);
/** * Returns the execution environment identifier in the following JRE * classpath container path, or <code>null</code> if none. * * @param jreContainerPath classpath container path * @return execution environment identifier or <code>null</code> * @since 3.2 */ public static String getExecutionEnvironmentId(IPath jreContainerPath) { return JREContainerInitializer.getExecutionEnvironmentId(jreContainerPath); }
/** * Returns a path for the JRE classpath container identifying the * specified execution environment. * * @param environment execution environment * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(IExecutionEnvironment environment) { IPath path = newDefaultJREContainerPath(); path = path.append(StandardVMType.ID_STANDARD_VM_TYPE); path = path.append(JREContainerInitializer.encodeEnvironmentId(environment.getId())); return path; }
/** * Returns the JRE referenced by the specified JRE classpath container * path or <code>null</code> if none. * * @param jreContainerPath the path to the container to try and resolve the {@link IVMInstall} from * @return JRE referenced by the specified JRE classpath container * path or <code>null</code> * @since 3.2 */ public static IVMInstall getVMInstall(IPath jreContainerPath) { return JREContainerInitializer.resolveVM(jreContainerPath); }
/** * Returns the identifier of the VM install type referenced by the * given JRE classpath container path, or <code>null</code> if none. * * @param jreContainerPath the path to the container to try and resolve the {@link IVMInstallType} id from * @return VM install type identifier or <code>null</code> * @since 3.2 */ public static String getVMInstallTypeId(IPath jreContainerPath) { if (JREContainerInitializer.isExecutionEnvironment(jreContainerPath)) { return null; } return JREContainerInitializer.getVMTypeId(jreContainerPath); }
/** * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) */ @Override public String getDescription(IPath containerPath, IJavaProject project) { String tag = getExecutionEnvironmentId(containerPath); if (tag == null && containerPath.segmentCount() > 2) { tag = getVMName(containerPath); } if (tag != null) { return NLS.bind(LaunchingMessages.JREContainer_JRE_System_Library_1, new String[]{tag}); } return LaunchingMessages.JREContainerInitializer_Default_System_Library_1; } }