/** * Creates and returns a classpath entry describing * the default JRE container entry. * * @return a new IClasspathEntry that describes the default JRE container entry * @since 2.0 */ public static IClasspathEntry getDefaultJREContainerEntry() { return JavaCore.newContainerEntry(newDefaultJREContainerPath()); }
/** * Creates and returns a classpath entry describing * the default JRE container entry. * * @return a new IClasspathEntry that describes the default JRE container entry * @since 2.0 */ public static IClasspathEntry getDefaultJREContainerEntry() { return JavaCore.newContainerEntry(newDefaultJREContainerPath()); }
/** * Returns a path for the JRE classpath container identifying the * specified VM install by type and name. * * @param typeId VM install type identifier * @param name VM install name * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(String typeId, String name) { IPath path = newDefaultJREContainerPath(); path = path.append(typeId); path = path.append(name); return path; }
/** * Returns a path for the JRE classpath container identifying the * specified VM install by type and name. * * @param typeId VM install type identifier * @param name VM install name * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(String typeId, String name) { IPath path = newDefaultJREContainerPath(); path = path.append(typeId); path = path.append(name); return path; }
protected void selectJRE(String typeID, String vmName) { if (typeID == null) { fJREBlock.setPath(JavaRuntime.newDefaultJREContainerPath()); } else { fJREBlock.setPath(JavaRuntime.newJREContainerPath(typeID, vmName)); } }
private void computeClasspath(IJavaProject project, IProgressMonitor monitor) { IClasspathEntry[] classpath = new IClasspathEntry[2]; classpath[0] = JavaCore.newContainerEntry(JavaRuntime.newDefaultJREContainerPath()); classpath[1] = JavaCore.newContainerEntry(PDECore.JAVA_SEARCH_CONTAINER_PATH); try { project.setRawClasspath(classpath, monitor); } catch (JavaModelException e) { } }
/** * Returns the JRE container path for the execution environment with the given id. * @param ee execution environment id or <code>null</code> * @return JRE container path for the execution environment */ private static IPath getEEPath(String ee) { IPath path = null; if (ee != null) { IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager(); IExecutionEnvironment env = manager.getEnvironment(ee); if (env != null) path = JavaRuntime.newJREContainerPath(env); } if (path == null) { path = JavaRuntime.newDefaultJREContainerPath(); } return path; }
/** * 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 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 a classpath container path identifying the selected JRE. * * @return classpath container path or <code>null</code> * @since 3.2 */ public IPath getPath() { if (!getStatus().isOK() && fErrorPath != null) { return fErrorPath; } if (fEnvironmentsButton.getSelection()) { int index = fEnvironmentsCombo.getSelectionIndex(); if (index >= 0) { IExecutionEnvironment env = (IExecutionEnvironment) fEnvironments.get(index); return JavaRuntime.newJREContainerPath(env); } return null; } if (fSpecificButton.getSelection()) { int index = fCombo.getSelectionIndex(); if (index >= 0) { IVMInstall vm = (IVMInstall) fVMs.get(index); return JavaRuntime.newJREContainerPath(vm); } return null; } return JavaRuntime.newDefaultJREContainerPath(); }
protected List<String> getPackageFragmentRootHandles(IJavaProject project) { List<String> result = Lists.newArrayList(); try { IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots(); for (IPackageFragmentRoot root : roots) { if (root != null && !JavaRuntime.newDefaultJREContainerPath().isPrefixOf(root.getRawClasspathEntry().getPath())) { result.add(root.getHandleIdentifier()); } } } catch (JavaModelException e) { if (!e.isDoesNotExist()) { log.error("Cannot find rootHandles in project " + project.getProject().getName(), e); } } return result; }
IPath initialPath = null; if (JavaRuntime.JRELIB_VARIABLE.equals(lib)) { initialPath = JavaRuntime.newDefaultJREContainerPath(); } else if (JavaRuntime.JRE_CONTAINER.equals(lib)) { initialPath = oldPath;
/** * Handle all fragment roots that are on the classpath and not a source folder. */ private boolean shouldHandle(IPackageFragmentRoot root) { try { boolean result = !JavaRuntime.newDefaultJREContainerPath().isPrefixOf(root.getRawClasspathEntry().getPath()); result &= (root.isArchive() || root.isExternal()); return result; } catch (JavaModelException ex) { if (!ex.isDoesNotExist()) log.error(ex.getMessage(), ex); return false; } }
/** * Initlaizes the JRE selection */ protected void initializeFromSelection() { if (getControl() != null) { if (fSelection == null) { fJREBlock.setPath(JavaRuntime.newDefaultJREContainerPath()); } else { fJREBlock.setPath(fSelection.getPath()); IStatus status = fJREBlock.getStatus(); if (!status.isOK()) { setErrorMessage(status.getMessage()); } } } }
containerPath = newDefaultJREContainerPath(); } else { if (isModularConfiguration(configuration)) { String name = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String)null); if (name != null) { containerPath = newDefaultJREContainerPath().append(type).append(name);
fCompilerCompliance= bestVersion; } else { fVMPath= JavaRuntime.newDefaultJREContainerPath();
if(JavaRuntime.newDefaultJREContainerPath().equals(vmPath)) { if(javaProject.isOpen()) { try {
continue; IPath currentPath = entries[i].getPath(); if (JavaRuntime.newDefaultJREContainerPath().matchingFirstSegments(currentPath) == 0) continue;
private void createJREGroup(Composite container) { Group group = SWTFactory.createGroup(container, PDEUIMessages.EnvironmentBlock_jreTitle, 2, 1, GridData.FILL_HORIZONTAL); initializeJREValues(); SWTFactory.createWrapLabel(group, PDEUIMessages.JRESection_description, 2); fDefaultJREButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_defaultJRE, 2); fDefaultJREButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newDefaultJREContainerPath()); })); fNamedJREButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_JREName); fNamedJREButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getText()))); })); fNamedJREsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, VMUtil.getVMInstallNames()); fNamedJREsCombo.addModifyListener(e -> getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getText())))); fExecEnvButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_ExecutionEnv); fExecEnvButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getText()))); })); fExecEnvsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, fExecEnvChoices.toArray(new String[fExecEnvChoices.size()])); fExecEnvsCombo.addModifyListener(e -> getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getText())))); }