Author: scabanovich
Date: 2010-04-21 09:55:32 -0400 (Wed, 21 Apr 2010)
New Revision: 21580
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5974
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2010-04-21
12:19:20 UTC (rev 21579)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2010-04-21
13:55:32 UTC (rev 21580)
@@ -44,6 +44,7 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import
org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.server.core.IRuntime;
@@ -394,9 +395,19 @@
FacetDataModelMap map = (FacetDataModelMap)
dataModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
IDataModel configDM = (IDataModel) map.get("jst.web"); //$NON-NLS-1$
+ boolean hasJSTWebFacet = false;
if(exists) {
IFacetedProject fp0 = ProjectFacetsManager.create(getProject());
exists = fp0 != null;
+ if(exists) {
+ Set<IProjectFacetVersion> vs = fp0.getProjectFacets();
+ if(vs != null) for (IProjectFacetVersion v: vs) {
+ String id = v.getProjectFacet().getId();
+ if("jst.web".equals(id)) { //$NON-NLS-1$
+ hasJSTWebFacet = true;
+ }
+ }
+ }
}
if(sv != null && (sv.indexOf("2.3") >= 0 ||
sv.indexOf("2.5") >= 0)) { //$NON-NLS-1$ //$NON-NLS-2$
@@ -448,7 +459,7 @@
ProjectUtilities.addNatureToProject(getProject(), emfNature);
}
}
- if(!exists) {
+ if(!exists || !hasJSTWebFacet) {
return wcco;
} else {
return null;