Author: scabanovich
Date: 2007-10-15 11:54:15 -0400 (Mon, 15 Oct 2007)
New Revision: 4198
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-982
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-10-15
15:48:15 UTC (rev 4197)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-10-15
15:54:15 UTC (rev 4198)
@@ -53,7 +53,7 @@
* @param runtime
* @return
*/
- public void setRuntime(SeamRuntime runtime);
+ public void setRuntimeName(String runtimeName);
/**
* Returns list of scope objects for all scope types.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-10-15
15:48:15 UTC (rev 4197)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-10-15
15:54:15 UTC (rev 4198)
@@ -74,7 +74,6 @@
boolean useDefaultRuntime = false;
String runtimeName = null;
- SeamRuntime runtime = null;
Set<IPath> sourcePaths = new HashSet<IPath>();
@@ -167,7 +166,7 @@
if(useDefaultRuntime) {
return SeamRuntimeManager.getInstance().getDefaultRuntime();
}
- return runtime;
+ return runtimeName == null ? null :
SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
}
public String getParentProjectName() {
@@ -175,15 +174,14 @@
return p == null ? null : p.get("seam.parent.project", null);
}
- public void setRuntime(SeamRuntime runtime) {
- if(this.runtime == runtime) return;
- useDefaultRuntime = runtime == SeamRuntimeManager.getInstance().getDefaultRuntime();
+ public void setRuntimeName(String runtimeName) {
+ if(this.runtimeName == runtimeName) return;
+ if(this.runtimeName != null && this.runtimeName.equals(runtimeName)) return;
+ SeamRuntime d = SeamRuntimeManager.getInstance().getDefaultRuntime();
+
+ useDefaultRuntime = d != null && d.getName().equals(runtimeName);
if(useDefaultRuntime) {
- this.runtime = null;
this.runtimeName = null;
- } else {
- this.runtime = runtime;
- this.runtimeName = runtime == null ? null : runtime.getName();
}
storeRuntime();
}
@@ -256,19 +254,19 @@
if(prefs == null) return;
runtimeName = prefs.get(RUNTIME_NAME, null);
if(runtimeName != null) {
- runtime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
} else {
useDefaultRuntime = true;
- runtime = null;
storeRuntime();
}
SeamCorePlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new
Preferences.IPropertyChangeListener() {
public void propertyChange(Preferences.PropertyChangeEvent event) {
- if(SeamFacetPreference.RUNTIME_LIST.equals(event.getProperty()) && runtime !=
null && runtime.isDefault()) {
- runtime = null;
- runtimeName = null;
- useDefaultRuntime = true;
- storeRuntime();
+ if(SeamFacetPreference.RUNTIME_LIST.equals(event.getProperty())) {
+ SeamRuntime d = SeamRuntimeManager.getInstance().getDefaultRuntime();
+ if(d != null && d.getName().equals(runtimeName)) {
+ runtimeName = null;
+ useDefaultRuntime = true;
+ storeRuntime();
+ }
}
}
});
Show replies by date