Author: rob.stryker(a)jboss.com
Date: 2009-12-16 22:02:13 -0500 (Wed, 16 Dec 2009)
New Revision: 19378
Modified:
trunk/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:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-17
00:46:19 UTC (rev 19377)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-17
03:02:13 UTC (rev 19378)
@@ -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;
Show replies by date