/** * Removes the VM from this container. * * @param vm VM install */ public void removeVM(IVMInstall vm) { fVMList.remove(vm); fInvalidVMList.remove(vm); List<IVMInstall> list = fVMTypeToVMMap.get(vm.getVMInstallType()); if (list != null) { list.remove(vm); } }
/** * Removes the VM from this container. * * @param vm VM install */ public void removeVM(IVMInstall vm) { fVMList.remove(vm); fInvalidVMList.remove(vm); List<IVMInstall> list = fVMTypeToVMMap.get(vm.getVMInstallType()); if (list != null) { list.remove(vm); } }
IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER); IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall(); IPath vmPath = containerPath .append(vmInstall.getVMInstallType().getId()) .append(vmInstall.getName()); IClasspathEntry jreEntry = JavaCore.newContainerEntry(vmPath);
private IVMInstall findFirstJava5OrGreaterJvm(IVMInstall jvmInstall) throws UnknownJvmVersionException { IVMInstall[] installs = jvmInstall.getVMInstallType().getVMInstalls(); for (IVMInstall candidate : installs) { if (parseMajorVersion(candidate) >= 5) { return candidate; } } return null; }
/** * Construct a <code>VMStandin</code> instance based on the specified <code>IVMInstall</code>. * Changes to this stand-in will not be reflected in the 'real' VM until <code>convertToRealVM</code> * is called. * * @param realVM the 'real' VM from which to construct this stand-in VM */ public VMStandin(IVMInstall realVM) { this (realVM.getVMInstallType(), realVM.getId()); init(realVM); }
@Override public boolean equals(Object object) { if (object instanceof IVMInstall) { IVMInstall vm = (IVMInstall)object; return getVMInstallType().equals(vm.getVMInstallType()) && getId().equals(vm.getId()); } return false; }
/** * Construct a <code>VMStandin</code> instance based on the specified <code>IVMInstall</code>. * Changes to this stand-in will not be reflected in the 'real' VM until <code>convertToRealVM</code> * is called. * * @param realVM the 'real' VM from which to construct this stand-in VM */ public VMStandin(IVMInstall realVM) { this (realVM.getVMInstallType(), realVM.getId()); init(realVM); }
/** * Constructs a copy of the specified VM with the given identifier. * * @param sourceVM the original VM * @param id the new ID to use * @since 3.2 */ public VMStandin(IVMInstall sourceVM, String id) { super(sourceVM.getVMInstallType(), id); setNotify(false); init(sourceVM); }
/** * Constructs a copy of the specified VM with the given identifier. * * @param sourceVM the original VM * @param id the new ID to use * @since 3.2 */ public VMStandin(IVMInstall sourceVM, String id) { super(sourceVM.getVMInstallType(), id); setNotify(false); init(sourceVM); }
@Override public boolean equals(Object object) { if (object instanceof IVMInstall) { IVMInstall vm = (IVMInstall)object; return getVMInstallType().equals(vm.getVMInstallType()) && getId().equals(vm.getId()); } return false; }
public int compare(Viewer viewer, Object e1, Object e2) { if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) { IVMInstall left= (IVMInstall)e1; IVMInstall right= (IVMInstall)e2; String leftType= left.getVMInstallType().getName(); String rightType= right.getVMInstallType().getName(); int res= leftType.compareToIgnoreCase(rightType); if (res != 0) { return res; } return left.getName().compareToIgnoreCase(right.getName()); } return super.compare(viewer, e1, e2); }
/** * Returns a path for the JRE classpath container identifying the * specified VM install by type and name. * * @param vm VM install * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(IVMInstall vm) { return newJREContainerPath(vm.getVMInstallType().getId(), vm.getName()); }
/** * Returns a path for the JRE classpath container identifying the * specified VM install by type and name. * * @param vm VM install * @return classpath container path * @since 3.2 */ public static IPath newJREContainerPath(IVMInstall vm) { return newJREContainerPath(vm.getVMInstallType().getId(), vm.getName()); }
@SuppressWarnings("deprecation") private void setDefaultVMInstallAttributes(IVMInstall defaultVMInstall, ILaunchConfigurationWorkingCopy config) { String vmName = defaultVMInstall.getName(); String vmTypeID = defaultVMInstall.getVMInstallType().getId(); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, vmName); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmTypeID); }
public void setVMInstall(IVMInstall vmInstall) { if (vmInstall == null) { setVMInstall(null, null); } else setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId()); }
public void setVMInstall(IVMInstall vmInstall) { if (vmInstall == null) { setVMInstall(null, null); } else setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId()); }
public static void setCompatibleVMs(String id) { // update all environments compatible to use the test JRE IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager(); IExecutionEnvironment[] environments = manager.getExecutionEnvironments(); for (IExecutionEnvironment environment : environments) { IVMInstall[] compatibleVMs = environment.getCompatibleVMs(); for (IVMInstall compatibleVM : compatibleVMs) { if (id.equals(compatibleVM.getVMInstallType().getId()) && compatibleVM.getVMInstallType().findVMInstall(compatibleVM.getId()) != null && !compatibleVM.equals(environment.getDefaultVM()) // Fugly way to ensure the lowest VM version is set: && (environment.getDefaultVM() == null || compatibleVM.getId().compareTo(environment.getDefaultVM().getId()) < 0)) { environment.setDefaultVM(compatibleVM); } } } } }
/** * 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); }
/** * Set the VM attributes on the working copy based on the workbench default VM. */ private void initializeDefaultVM(ILaunchConfigurationWorkingCopy config) { IVMInstall vmInstall= JavaRuntime.getDefaultVMInstall(); if (vmInstall == null) { config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String)null); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); } else { config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, vmInstall.getName()); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmInstall.getVMInstallType().getId()); } }
/** * 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; }