/** * @see IClasspathContainer#getDescription() */ @Override public String getDescription() { String environmentId = JavaRuntime.getExecutionEnvironmentId(getPath()); String tag = null; if (environmentId == null) { tag = fVMInstall.getName(); } else { tag = environmentId; } return NLS.bind(LaunchingMessages.JREContainer_JRE_System_Library_1, new String[]{tag}); }
/** * @see IClasspathContainer#getDescription() */ @Override public String getDescription() { String environmentId = JavaRuntime.getExecutionEnvironmentId(getPath()); String tag = null; if (environmentId == null) { tag = fVMInstall.getName(); } else { tag = environmentId; } return NLS.bind(LaunchingMessages.JREContainer_JRE_System_Library_1, new String[]{tag}); }
/** * Returns the classpath entries associated with the given VM * in the context of the given path and project. * * @param vm the VM * @param containerPath the container path resolution is for * @param project project the resolution is for * @return classpath entries */ private static IClasspathEntry[] getClasspathEntries(IVMInstall vm, IPath containerPath, IJavaProject project) { String id = JavaRuntime.getExecutionEnvironmentId(containerPath); IClasspathEntry[] entries = null; if (id == null) { // cache classpath entries per JRE when not bound to an EE entries = fgClasspathEntries.get(vm); if (entries == null) { entries = computeClasspathEntries(vm, project, id); fgClasspathEntries.put(vm, entries); } } else { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { LaunchingPlugin.trace("\tEE:\t" + id); //$NON-NLS-1$ } // dynamically compute entries when bound to an EE entries = computeClasspathEntries(vm, project, id); } return entries; }
/** * Returns the classpath entries associated with the given VM * in the context of the given path and project. * * @param vm the VM * @param containerPath the container path resolution is for * @param project project the resolution is for * @return classpath entries */ private static IClasspathEntry[] getClasspathEntries(IVMInstall vm, IPath containerPath, IJavaProject project) { String id = JavaRuntime.getExecutionEnvironmentId(containerPath); IClasspathEntry[] entries = null; if (id == null) { // cache classpath entries per JRE when not bound to an EE entries = fgClasspathEntries.get(vm); if (entries == null) { entries = computeClasspathEntries(vm, project, id); fgClasspathEntries.put(vm, entries); } } else { if (LaunchingPlugin.DEBUG_JRE_CONTAINER) { LaunchingPlugin.trace("\tEE:\t" + id); //$NON-NLS-1$ } // dynamically compute entries when bound to an EE entries = computeClasspathEntries(vm, project, id); } return entries; }
/** * Sets the default compiler compliance options iff <code>modifiedClassPathEntries</code> * contains a classpath container entry that is modified or new and that points to an execution * environment. Does nothing if the EE or the options could not be resolved. * * @param javaProject the Java project * @param modifiedClassPathEntries a list of {@link CPListElement} * * @see #getEEOptions(IExecutionEnvironment) * * @since 3.5 */ public static void setEEComplianceOptions(IJavaProject javaProject, List<CPListElement> modifiedClassPathEntries) { for (Iterator<CPListElement> iter= modifiedClassPathEntries.iterator(); iter.hasNext();) { CPListElement entry= iter.next(); if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path= entry.getPath(); if (! path.equals(entry.getOrginalPath())) { String eeID= JavaRuntime.getExecutionEnvironmentId(path); if (eeID != null) { setEEComplianceOptions(javaProject, eeID, null); return; } } } } }
/** * Sets the default compiler compliance options iff <code>modifiedClassPathEntries</code> * contains a classpath container entry that is modified or new and that points to an execution * environment. Does nothing if the EE or the options could not be resolved. * * @param javaProject the Java project * @param modifiedClassPathEntries a list of {@link CPListElement} * * @see #getEEOptions(IExecutionEnvironment) * * @since 3.5 */ public static void setEEComplianceOptions(IJavaProject javaProject, List<CPListElement> modifiedClassPathEntries) { for (Iterator<CPListElement> iter= modifiedClassPathEntries.iterator(); iter.hasNext();) { CPListElement entry= iter.next(); if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path= entry.getPath(); if (! path.equals(entry.getOrginalPath())) { String eeID= JavaRuntime.getExecutionEnvironmentId(path); if (eeID != null) { setEEComplianceOptions(javaProject, eeID, null); return; } } } } }
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (result.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path= result.getPath(); String eeID= JavaRuntime.getExecutionEnvironmentId(path); if (eeID != null) { BuildPathSupport.setEEComplianceOptions(fJavaProject, eeID, null); } } fJavaProject.setRawClasspath(newEntries, fJavaProject.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (result.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path= result.getPath(); String eeID= JavaRuntime.getExecutionEnvironmentId(path); if (eeID != null) { BuildPathSupport.setEEComplianceOptions(fJavaProject, eeID, null); } } fJavaProject.setRawClasspath(newEntries, fJavaProject.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
eeId = JavaRuntime.getExecutionEnvironmentId(jrePath); if (eeId == null) { vmInstallName = JavaRuntime.getVMInstallName(jrePath);
IVMInstall vm = JavaRuntime.getVMInstall(jrePath); if (vm == null) { String id = JavaRuntime.getExecutionEnvironmentId(jrePath); if (id == null) { String name = JavaRuntime.getVMInstallName(jrePath);
/** * Return the class that implements <code>ILaunchConfigurationTab</code> * that is registered against the install type of the currently selected VM. */ protected ILaunchConfigurationTab getTabForCurrentJRE() { if (!fJREBlock.isDefaultJRE()) { IPath path = fJREBlock.getPath(); if (path != null && JavaRuntime.getExecutionEnvironmentId(path) == null) { IVMInstall vm = fJREBlock.getJRE(); if (vm != null) { String vmInstallTypeID = vm.getVMInstallType().getId(); return JDIDebugUIPlugin.getDefault().getVMInstallTypePage(vmInstallTypeID); } } } return null; }
private IExecutionEnvironment getEE() { if (fProject == null) return null; try { IClasspathEntry[] entries= JavaCore.create(fProject).getRawClasspath(); for (int i= 0; i < entries.length; i++) { IClasspathEntry entry= entries[i]; if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { String eeId= JavaRuntime.getExecutionEnvironmentId(entry.getPath()); if (eeId != null) { return JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(eeId); } } } } catch (CoreException e) { JavaPlugin.log(e); } return null; }
private IExecutionEnvironment getEE() { if (fProject == null) return null; try { IClasspathEntry[] entries= JavaCore.create(fProject).getRawClasspath(); for (int i= 0; i < entries.length; i++) { IClasspathEntry entry= entries[i]; if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { String eeId= JavaRuntime.getExecutionEnvironmentId(entry.getPath()); if (eeId != null) { return JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(eeId); } } } } catch (CoreException e) { JavaPlugin.log(e); } return null; }
@Override public void refresh() { fBlockChanges = true; fLastTab = fTabFolder.getSelectionIndex(); fEEButton.setSelection(getJVMLocations().includeJREWithProduct(getOS(fLastTab))); IPath jrePath = getJVMLocations().getJREContainerPath(getOS(fLastTab)); if (jrePath != null) { String eeID = JavaRuntime.getExecutionEnvironmentId(jrePath); IExecutionEnvironment env = VMUtil.getExecutionEnvironment(eeID); if (env != null) { if (!fEEsCombo.getItems().contains(env)) fEEsCombo.addItem(env); fEEsCombo.select(env); } else { IVMInstall install = JavaRuntime.getVMInstall(jrePath); if (install != null) { fEEsCombo.select(null); } } } else { fEEsCombo.select(null); } updateWidgets(); super.refresh(); fBlockChanges = false; }
vm = JavaRuntime.getVMInstall(vmPath); String environmentId = JavaRuntime.getExecutionEnvironmentId(vmPath); if(vm instanceof AbstractVMInstall) { AbstractVMInstall install = (AbstractVMInstall) vm;
fDefaultJREButton.setSelection(true); } else { String ee = JavaRuntime.getExecutionEnvironmentId(jrePath); if (ee != null) { fExecEnvButton.setSelection(true);
@Override @SuppressWarnings("deprecation") public void performApply(ILaunchConfigurationWorkingCopy configuration) { boolean isDefaultJRE = fJREBlock.isDefaultJRE(); fWorkingDirectoryBlock.setEnabled(!isDefaultJRE); fVMArgumentsBlock.setEnabled(!isDefaultJRE); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String) null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String) null); if (isDefaultJRE) { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, (String) null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null); configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, false); } else { super.performApply(configuration); IVMInstall vm = fJREBlock.getJRE(); IPath path = fJREBlock.getPath(); String id = JavaRuntime.getExecutionEnvironmentId(path); configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, ((vm == null || id != null) ? false : vm.equals(getDefaultVMInstall(configuration)))); applySeparateVMAttributes(configuration); fVMArgumentsBlock.performApply(configuration); fWorkingDirectoryBlock.performApply(configuration); } setLaunchConfigurationWorkingCopy(configuration); }
setUseDefaultJRE(); } else { String envId = JavaRuntime.getExecutionEnvironmentId(containerPath); if (envId != null) { IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
IPath currentPath = entries[i].getPath(); if (JavaRuntime.newDefaultJREContainerPath().matchingFirstSegments(currentPath) > 0) { String eeId = JavaRuntime.getExecutionEnvironmentId(currentPath); if (eeId != null) { IMarker marker = report(PDECoreMessages.BundleErrorReporter_noExecutionEnvironmentSet, 1, sev, PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET, PDEMarkerFactory.CAT_EE);