/** * Add all VM's in the specified list to the VM definitions managed by this container. * <p> * If distinguishing valid from invalid VMs is important, the specified VMs must * have already had their install locations set. An invalid VM is one whose install * location doesn't exist. * </p> * * @param vmList a list of VMs to be added to this container */ public void addVMList(List<IVMInstall> vmList) { Iterator<IVMInstall> iterator = vmList.iterator(); while (iterator.hasNext()) { addVM(iterator.next()); } }
/** * Add all VM's in the specified list to the VM definitions managed by this container. * <p> * If distinguishing valid from invalid VMs is important, the specified VMs must * have already had their install locations set. An invalid VM is one whose install * location doesn't exist. * </p> * * @param vmList a list of VMs to be added to this container */ public void addVMList(List<IVMInstall> vmList) { Iterator<IVMInstall> iterator = vmList.iterator(); while (iterator.hasNext()) { addVM(iterator.next()); } }
container.addVM(vmStandin);
container.addVM(vmStandin);
/** * Updates VM settings and returns whether the update was successful. * * @param jres new installed JREs * @param defaultJRE new default VM * @return whether the update was successful */ public boolean updateJRESettings(IVMInstall[] jres, IVMInstall defaultJRE) { // Create a VM definition container VMDefinitionsContainer vmContainer = new VMDefinitionsContainer(); // Set the default VM Id on the container String defaultVMId = JavaRuntime.getCompositeIdFromVM(defaultJRE); vmContainer.setDefaultVMInstallCompositeID(defaultVMId); // Set the VMs on the container for (int i = 0; i < jres.length; i++) { vmContainer.addVM(jres[i]); } // Generate XML for the VM defs and save it as the new value of the VM preference saveVMDefinitions(vmContainer); return true; }
/** * Contstructs a new VM updater to update VM install settings. */ public JREsUpdater() { fOriginalVMs = new VMDefinitionsContainer(); IVMInstall def = JavaRuntime.getDefaultVMInstall(); if (def != null) { fOriginalVMs.setDefaultVMInstallCompositeID(JavaRuntime.getCompositeIdFromVM(def)); } IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstall[] vms = types[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { fOriginalVMs.addVM(vms[j]); } } }
vmDefs.addVM(standin);
/** * Returns the listing of currently installed VMs as a single XML file * @return an XML representation of all of the currently installed VMs * @throws CoreException if trying to compute the XML for the VM state encounters a problem */ private static String getVMsAsXML() throws CoreException { VMDefinitionsContainer container = new VMDefinitionsContainer(); container.setDefaultVMInstallCompositeID(getDefaultVMId()); container.setDefaultVMInstallConnectorTypeID(getDefaultVMConnectorId()); IVMInstallType[] vmTypes = getVMInstallTypes(); IVMInstall[] vms = null; for (int i = 0; i < vmTypes.length; ++i) { vms = vmTypes[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { container.addVM(vms[j]); } } return container.getAsXML(); }
/** * Returns the listing of currently installed VMs as a single XML file * @return an XML representation of all of the currently installed VMs * @throws CoreException if trying to compute the XML for the VM state encounters a problem */ private static String getVMsAsXML() throws CoreException { VMDefinitionsContainer container = new VMDefinitionsContainer(); container.setDefaultVMInstallCompositeID(getDefaultVMId()); container.setDefaultVMInstallConnectorTypeID(getDefaultVMConnectorId()); IVMInstallType[] vmTypes = getVMInstallTypes(); IVMInstall[] vms = null; for (int i = 0; i < vmTypes.length; ++i) { vms = vmTypes[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { container.addVM(vms[j]); } } return container.getAsXML(); }
if (runtime != null) { updateCompliance = true; vmDefs.addVM(runtime); vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(runtime));
if (runtime != null) { updateCompliance = true; vmDefs.addVM(runtime); vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(runtime));