Author: bfitzpat
Date: 2011-03-15 18:27:37 -0400 (Tue, 15 Mar 2011)
New Revision: 29805
Modified:
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java
Log:
OPEN - issue JBIDE-8127: cannot edit wrong JBossWS runtime
https://issues.jboss.org/browse/JBIDE-8127
Modified:
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
===================================================================
---
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2011-03-15
22:21:48 UTC (rev 29804)
+++
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2011-03-15
22:27:37 UTC (rev 29805)
@@ -104,6 +104,7 @@
if (jbws != null) {
this.tempJbws.setUserConfigClasspath(jbws.isUserConfigClasspath());
this.tempJbws.getLibraries().addAll(jbws.getLibraries());
+ this.tempJbws.setVersion(jbws.getVersion());
}
}
Modified:
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java
===================================================================
---
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java 2011-03-15
22:21:48 UTC (rev 29804)
+++
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java 2011-03-15
22:27:37 UTC (rev 29805)
@@ -466,12 +466,17 @@
name.addPropertyChangeListener(this);
version.doFillIntoGrid(root);
version.addPropertyChangeListener(this);
- version.setValue(getWSFacetVersions().get(1));
+ if (current != null)
+ version.setValue(current.getVersion());
+ else
+ version.setValue(getWSFacetVersions().get(1));
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
jars = new JBossWSLibraryListFieldEditor("", "", current);
//$NON-NLS-1$ //$NON-NLS-2$
jars.doFillIntoGrid(root);
+
+
jars.addPropertyChangeListener(this);
setPageComplete(false);
setControl(root);
@@ -525,28 +530,30 @@
}
}
- JBossWSRuntime jarJbws = (JBossWSRuntime) jars.getValue();
- if (current != null
- && current.getName().equals(name.getValueAsString())
- && current.getHomeDir().equals(homeDir.getValueAsString())
- && current.getVersion().equals(version.getValueAsString())
- && current.isUserConfigClasspath() == jarJbws
- .isUserConfigClasspath()
- && (!jarJbws.isUserConfigClasspath() || hasSameLibraies(
- current.getLibraries(), jarJbws.getLibraries()))) {
-
- setErrorMessage(null);
- setPageComplete(false);
- return;
+ if (jars != null) {
+ JBossWSRuntime jarJbws = (JBossWSRuntime) jars.getValue();
+ if (current != null
+ && current.getName().equals(name.getValueAsString())
+ && current.getHomeDir().equals(homeDir.getValueAsString())
+ && current.getVersion().equals(version.getValueAsString())
+ && current.isUserConfigClasspath() == jarJbws
+ .isUserConfigClasspath()
+ && (!jarJbws.isUserConfigClasspath() || hasSameLibraies(
+ current.getLibraries(), jarJbws.getLibraries()))) {
+
+ setErrorMessage(null);
+ setPageComplete(false);
+ return;
+ }
+
+ if (jarJbws.isUserConfigClasspath()
+ && jarJbws.getLibraries().size() == 0) {
+ setErrorMessage(JBossWSUIMessages.JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar);
+ setPageComplete(false);
+ return;
+ }
}
- if (jarJbws.isUserConfigClasspath()
- && jarJbws.getLibraries().size() == 0) {
- setErrorMessage(JBossWSUIMessages.JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar);
- setPageComplete(false);
- return;
- }
-
if (homeDir.getValueAsString() == null
|| "".equals(homeDir.getValueAsString().trim())) { //$NON-NLS-1$
setErrorMessage(JBossWSUIMessages.Error_JBossWS_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty);