Author: rob.stryker(a)jboss.com
Date: 2009-12-17 13:44:36 -0500 (Thu, 17 Dec 2009)
New Revision: 19445
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
Log:
JBIDE-5496 - annoying esb runtime version unset
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-17
18:43:06 UTC (rev 19444)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-17
18:44:36 UTC (rev 19445)
@@ -581,8 +581,24 @@
setPageComplete(false);
return;
}
-
+
if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue(),
configuration.getText())) {
+ final Combo vCombo = (Combo)this.version.getEditorControls()[1];
+ String[] vStrings = vCombo.getItems();
+ for( int i = 0; i < vStrings.length; i++ ) {
+ boolean works = runtimeExist(homeDir.getValueAsString(), vStrings[i],
configuration.getText());
+ if( works ) {
+ final String newVersion = vStrings[i];
+ final int i2 = i;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ vCombo.select(i2);
+ version.setValue(newVersion);
+ }
+ });
+ return;
+ }
+ }
setErrorMessage(NLS.bind(JBossESBUIMessages.Label_JBoss_Runtime_Load_Error,
version.getValue()));
setPageComplete(false);
return;