You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2008/05/09 16:50:30 UTC

svn commit: r654831 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java

Author: mcconne
Date: Fri May  9 07:50:30 2008
New Revision: 654831

URL: http://svn.apache.org/viewvc?rev=654831&view=rev
Log:
GERONIMODEVTOOLS-342 Fixed setting the JRE on the Edit Server Runtime panel -- Thanks BJ Reed for the patch -- works great

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java?rev=654831&r1=654830&r2=654831&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java Fri May  9 07:50:30 2008
@@ -313,11 +313,16 @@
 
         combo.addSelectionListener(new SelectionListener() {
                                        public void widgetSelected(SelectionEvent e) {
+                                           // if the first item in the list is selected, then pass null
+                                           // to setVMInstall to use the default JRE.
+                                           // otherwise the array list of JRE's is one off from what is
+                                           // in the combo; subtract 1 from the selection to get the correct JRE.
                                            int sel = combo.getSelectionIndex();
                                            IVMInstall vmInstall = null;
-                                           if (sel > 0)
+                                           if (sel > 0) {
                                                vmInstall = (IVMInstall) installedJREs.get(sel - 1);
-                                           getGeronimoRuntime().setVMInstall(vmInstall);
+                                           }
+                                           getRuntimeDelegate().setVMInstall(vmInstall);
                                            validate();
                                        }
 
@@ -513,6 +518,10 @@
             }
         }
 
+        // The Default JRE will always be the first item in the combo.  This is
+        // an assumption that is made by the combo selection listener and that all
+        // other installed JREs are listed afterwards in the same order that they
+        // are found in the list of installed JREs
         size = installedJREs.size();
         jreNames = new String[size + 1];
         jreNames[0] = Messages.runtimeDefaultJRE;