Author: scabanovich
Date: 2007-10-16 09:50:35 -0400 (Tue, 16 Oct 2007)
New Revision: 4231
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/NewProjectRegisterPage.java
Log:
JBIDE-682
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/NewProjectRegisterPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/NewProjectRegisterPage.java 2007-10-16
13:50:27 UTC (rev 4230)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/NewProjectRegisterPage.java 2007-10-16
13:50:35 UTC (rev 4231)
@@ -61,6 +61,7 @@
private void initServletSupport() {
String defaultServletVersion = servletPreference.getValue();
+
XEntityData entityData = XEntityDataImpl.create(
new String[][]{{"WebPrjCreateStepDirs", ""},
{"servletVersion", ""}});
entityData.setValue("servletVersion", defaultServletVersion);
@@ -94,6 +95,7 @@
public void setVisible(boolean visible) {
if (visible) {
lock = true;
+ loadServletVersion();
appRegister.loadApplicationName();
lock = false;
}
@@ -101,6 +103,21 @@
super.setVisible(visible);
}
+ public void loadServletVersion() {
+ String currentServletVersion =
support.getPropertyEditorAdapterByName("servletVersion").getStringValue(true);
+
+ if(context != null && context.getProjectTemplate() != null) {
+ String prefServletVersion =
context.getProjectTemplate().getProjectVersion().getPreferredServletVersion();
+ if(prefServletVersion != null) {
+ int i = context.compareServletVersions(prefServletVersion, currentServletVersion);
+ if(i > 0) {
+ context.setServletVersion(prefServletVersion);
+ support.getPropertyEditorAdapterByName("servletVersion").setValue(prefServletVersion);
+ }
+ }
+ }
+ }
+
private boolean lock = false;
private boolean validatePage() {
@@ -108,6 +125,9 @@
try {
appRegister.commit();
String msg = appRegister.getErrorMessage();
+ if(msg == null) {
+ msg = context.validateServletVersion();
+ }
if(msg != null) {
setErrorMessage(msg);
return false;
Show replies by date