Author: scabanovich
Date: 2007-10-16 10:34:15 -0400 (Tue, 16 Oct 2007)
New Revision: 4232
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
Log:
JBIDE-682
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2007-10-16
13:50:35 UTC (rev 4231)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2007-10-16
14:34:15 UTC (rev 4232)
@@ -11,6 +11,7 @@
package org.jboss.tools.jst.web.project.helpers;
import java.util.*;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.*;
import org.jboss.tools.jst.web.context.RegisterServerContext;
@@ -38,6 +39,8 @@
protected RegisterServerContext registry;
+ Map<String, String> prefs = new HashMap<String, String>();
+
public NewWebProjectContext() {
registry = new RegisterServerContext(RegisterServerContext.PROJECT_MODE_NEW);
initRegistry();
@@ -94,6 +97,9 @@
public void setServletVersion(String value) {
servletVersion = value;
registry.setServletVersion(value);
+ if(version != null) {
+ prefs.put(version, value);
+ }
}
public String getServletVersion() {
@@ -112,6 +118,18 @@
if(version != null && version.equals(value)) return;
version = value;
projectTemplateEdit = template.getProjectTemplate(version, projectTemplate);
+
+ String sv = prefs.get(version);
+ if(sv != null) {
+ setServletVersion(sv);
+ }
+
+ String pref = projectTemplateEdit.getProjectVersion().getPreferredServletVersion();
+ if(pref != null && compareServletVersions(pref, servletVersion) > 0) {
+ setServletVersion(pref);
+ } else if(servletVersion != null) {
+ prefs.put(version, servletVersion);
+ }
}
public IWebProjectTemplate getTemplate() {
Show replies by date