private IVMInstall[] getWorkspaceJREs() { List<VMStandin> standins = new ArrayList<>(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
private IVMInstall[] getWorkspaceJREs() { List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return ((IVMInstall[])standins.toArray(new IVMInstall[standins.size()])); }
private IVMInstall[] getWorkspaceJREs() { List<VMStandin> standins = new ArrayList<>(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
private IVMInstall[] getWorkspaceJREs() { final List<VMStandin> standins = new ArrayList<>(); final IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { final IVMInstallType type = types[i]; final IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { final IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
/** * Populates the JRE table with existing JREs defined in the workspace. */ protected void fillWithWorkspaceJREs() { // fill with JREs List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } setJREs((IVMInstall[])standins.toArray(new IVMInstall[standins.size()])); }
/** * Populates the JRE table with existing JREs defined in the workspace. */ protected void fillWithWorkspaceJREs() { // fill with JREs List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } setJREs(standins); }
VMStandin vmStandin = new VMStandin(vmType, id); vmStandin.setName(name); File installLocation= new File(installPath);
private static IVMInstall registerNewVM(String name, File location) { // use the 'Standard VM' type to register a new VM IVMInstallType installType = JavaRuntime.getVMInstallType(StandardVMType.ID_STANDARD_VM_TYPE); // both the id and the name have to be unique for the registration String vmId = generateUniqueVMId(installType); // create the VM without firing events on individual method calls VMStandin vm = new VMStandin(installType, vmId); vm.setName(name); vm.setInstallLocation(location); return vm.convertToRealVM(); }
VMStandin vmStandin = new VMStandin(vmType, id); vmStandin.setName(name); File installLocation= new File(installPath);
public boolean configureVM() throws CoreException { String javaHome = preferenceManager.getPreferences().getJavaHome(); if (javaHome != null) { File jvmHome = new File(javaHome); if (jvmHome.isDirectory()) { IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); File location = defaultVM.getInstallLocation(); if (!location.equals(jvmHome)) { IVMInstall vm = findVM(jvmHome); if (vm == null) { IVMInstallType installType = JavaRuntime.getVMInstallType(StandardVMType.ID_STANDARD_VM_TYPE); long unique = System.currentTimeMillis(); while (installType.findVMInstall(String.valueOf(unique)) != null) { unique++; } String vmId = String.valueOf(unique); VMStandin vmStandin = new VMStandin(installType, vmId); String name = StringUtils.defaultIfBlank(jvmHome.getName(), "JRE"); vmStandin.setName(name); vmStandin.setInstallLocation(jvmHome); vm = vmStandin.convertToRealVM(); } JavaRuntime.setDefaultVMInstall(vm, new NullProgressMonitor()); JDTUtils.setCompatibleVMs(vm.getId()); return true; } } } return false; }
protected void okPressed() { if (fEditedVM == null) { IVMInstall vm = new VMStandin(fSelectedVMType, createUniqueId(fSelectedVMType)); setFieldValuesToVM(vm); fRequestor.vmAdded(vm); } else { setFieldValuesToVM(fEditedVM); } super.okPressed(); }
VMStandin detectedVMStandin = new VMStandin(vmType, vmID); detectedVMStandin.setInstallLocation(detectedLocation); detectedVMStandin.setName(generateDetectedVMName(detectedVMStandin));
VMStandin detectedVMStandin = new VMStandin(vmType, vmID); detectedVMStandin.setInstallLocation(detectedLocation); detectedVMStandin.setName(generateDetectedVMName(detectedVMStandin));
/** * Adds a duplicate of the selected VM to the block * @since 3.2 */ protected void copyVM() { IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection(); Iterator it = selection.iterator(); ArrayList newEntries = new ArrayList(); while (it.hasNext()) { IVMInstall selectedVM = (IVMInstall) it.next(); // duplicate & add vm VMStandin standin = new VMStandin(selectedVM, createUniqueId(selectedVM.getVMInstallType())); standin.setName(generateName(selectedVM.getName())); AddVMDialog dialog = new AddVMDialog(this, getShell(), JavaRuntime.getVMInstallTypes(), standin); dialog.setTitle(JREMessages.InstalledJREsBlock_18); if (dialog.open() != Window.OK) { return; } newEntries.add(standin); fVMs.add(standin); } fVMList.refresh(); fVMList.setSelection(new StructuredSelection(newEntries.toArray())); }
VMStandin standin = new VMStandin(vm); standin.setLibraryLocations(libs); standin.convertToRealVM();
VMStandin standin = new VMStandin(vm); standin.setLibraryLocations(libs); standin.convertToRealVM();
File location = (File)iter.next(); IVMInstallType type = (IVMInstallType)iter2.next(); IVMInstall vm = new VMStandin(type, createUniqueId(type)); String name = location.getName(); String nameCopy = new String(name);
protected IVMInstall addInstalledJre(IVMInstallType type, InstalledJre jreToAdd) throws Exception { IVMInstall retVal = findJre(jreToAdd.getVersion(), jreToAdd.getInstalledLocation()); if (retVal == null) { IStatus validationStatus = type.validateInstallLocation(jreToAdd.getInstalledLocation()); if (!validationStatus.isOK()) { throw new CoreException(validationStatus); } VMStandin vmStandin = new VMStandin(type, EcoreUtil.generateUUID()); vmStandin.setInstallLocation(jreToAdd.getInstalledLocation()); vmStandin.setName("JRE for " + jreToAdd.getVersion()); IVMInstall realVM = vmStandin.convertToRealVM(); retVal = realVM; } return retVal; }
IStatus status = EEVMType.validateDefinitionFile(description); if (status.isOK()) { VMStandin standin = new VMStandin(getVMInstallType(EEVMType.ID_EE_VM_TYPE), id); if (name != null && name.length() > 0){ standin.setName(name);
IStatus status = EEVMType.validateDefinitionFile(description); if (status.isOK()) { VMStandin standin = new VMStandin(getVMInstallType(EEVMType.ID_EE_VM_TYPE), id); if (name != null && name.length() > 0){ standin.setName(name);