Author: dgolovin
Date: 2008-03-13 14:05:02 -0400 (Thu, 13 Mar 2008)
New Revision: 6916
Modified:
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1786
compatibility level have changed from minor to major version:
1. If major versions selected and extracted from archive don't match, dialog shows
error
2. if major versions match but minor doesn't, dialog shows warning
So if you select seam-2.1.0.A1 dialog shows a warning but if you select seam-3.0.0 or
1.2.1 error is shown.
Modified:
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
---
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-03-13
17:55:14 UTC (rev 6915)
+++
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-03-13
18:05:02 UTC (rev 6916)
@@ -685,12 +685,14 @@
final String deploymentType = value.toString();
if(!ISeamFacetDataModelProperties.DEPLOY_AS_WAR.equals(deploymentType)) {
- String runtimeName =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME).toString();
- IRuntime rt = RuntimeManager.getRuntime(runtimeName);
- if(!rt.supports(EJB_30) || !rt.supports(EAR_50)) {
- return ValidatorFactory.createErrormessage(
- propertyName,
- NLS.bind(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CANNOT_USE_SELECTED_DEPLOYMENT6 ,
new String[]{deploymentType.toUpperCase(),runtimeName}));
+ Object runtimeName =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ if(runtimeName!=null) {
+ IRuntime rt = RuntimeManager.getRuntime(runtimeName.toString());
+ if(!rt.supports(EJB_30) || !rt.supports(EAR_50)) {
+ return ValidatorFactory.createErrormessage(
+ propertyName,
+ NLS.bind(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CANNOT_USE_SELECTED_DEPLOYMENT6 ,
new String[]{deploymentType.toUpperCase(),runtimeName.toString()}));
+ }
}
}
return ValidatorFactory.NO_ERRORS;
Modified:
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
---
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2008-03-13
17:55:14 UTC (rev 6915)
+++
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2008-03-13
18:05:02 UTC (rev 6916)
@@ -151,7 +151,7 @@
}
String version = (String) context;
- if(version.startsWith("2.0")) { //$NON-NLS-1$
+ if(version.startsWith("2.")) { //$NON-NLS-1$
File seamJarFile = new File(value.toString(), "lib/jboss-seam.jar");
//$NON-NLS-1$
if (!seamJarFile.isFile()) {
errors = createErrorMap();
Modified:
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
---
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2008-03-13
17:55:14 UTC (rev 6915)
+++
branches/jbosstools-2.0.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2008-03-13
18:05:02 UTC (rev 6916)
@@ -28,6 +28,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -539,9 +540,7 @@
}
if (seamVersion != null && validSeamVersions != null) {
for (SeamVersion ver : validSeamVersions) {
- if (seamVersion.matches(ver.toString().replace(".",
- "\\.")
- + ".*")) {
+ if (seamVersion.matches(ver.toString().substring(0,1)+ ".*")) {
version.setValue(ver.toString());
break;
}
@@ -599,15 +598,23 @@
setPageComplete(false);
return;
} else if ("".equals(seamVersion)) { //$NON-NLS-1$
- setErrorMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_CANNOT_OBTAIN_SEAM_VERSION_NUMBER);
- setPageComplete(false);
+ setMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_CANNOT_OBTAIN_SEAM_VERSION_NUMBER,
+ IMessageProvider.WARNING);
+ setPageComplete(true);
return;
} else if (!seamVersion.matches(version.getValueAsString().replace(
".", "\\.") + ".*")) { //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
- setErrorMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_THE_SELECTED_SEAM_APPEARS_TO_BE_OF_INCOMATIBLE_VERSION
- + seamVersion + "'"); //$NON-NLS-1$
- setPageComplete(false);
- return;
+ if(seamVersion.matches(version.getValueAsString().substring(0,1)+".*")) {
+ setMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_THE_SELECTED_SEAM_APPEARS_TO_BE_OF_INCOMATIBLE_VERSION
+ + seamVersion + "'", IMessageProvider.WARNING); //$NON-NLS-1$
+ } else {
+ setErrorMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_THE_SELECTED_SEAM_APPEARS_TO_BE_OF_INCOMATIBLE_VERSION
+ + seamVersion + "'"); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+ } else {
+ setMessage(null);
}
Map errors = ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR