private void setJREComboSelection(String vmInstallName) { if (vmInstallName != null) { fJreCombo.setText(vmInstallName); } if (fJreCombo.getSelectionIndex() == -1) { fJreCombo.setText(VMUtil.getDefaultVMInstallName()); } }
/** * Get the default VMInstall name using the available info in the config, * using the JavaProject if available. * * @param configuration * Launch configuration to check * @return name of the VMInstall * @throws CoreException * thrown if there's a problem getting the VM name */ public static String getDefaultVMInstallName(ILaunchConfiguration configuration) throws CoreException { IJavaProject javaProject = JavaRuntime.getJavaProject(configuration); IVMInstall vmInstall = null; if (javaProject != null) { vmInstall = JavaRuntime.getVMInstall(javaProject); } if (vmInstall != null) { return vmInstall.getName(); } return VMUtil.getDefaultVMInstallName(); }
String currentVM = fJreCombo.getText(); String currentEE = parseEESelection(fEeCombo.getText()); boolean useDefault = VMUtil.getDefaultVMInstallName().equals(currentVM); if (SWTFactory.showPreferencePage(fTab.getControl().getShell(), "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage", null) == Window.OK) { //$NON-NLS-1$ setJRECombo(); if (useDefault || fJreCombo.indexOf(currentVM) == -1) fJreCombo.setText(VMUtil.getDefaultVMInstallName()); else fJreCombo.setText(currentVM);
fNamedJREsCombo.setText(VMUtil.getDefaultVMInstallName());