Author: scabanovich
Date: 2009-05-14 11:50:38 -0400 (Thu, 14 May 2009)
New Revision: 15255
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java 2009-05-14
15:50:04 UTC (rev 15254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java 2009-05-14
15:50:38 UTC (rev 15255)
@@ -1,10 +1,15 @@
package org.jboss.tools.jsf.model.handlers;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.meta.action.SpecialWizard;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRemoveHandler;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.model.JSFConstants;
+import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
public class RemoveJSFNatureContribution implements SpecialWizard {
@@ -38,6 +43,15 @@
DefaultRemoveHandler.removeFromParent(params[i]);
}
}
+
+ IProject project = EclipseResourceUtil.getProject(model.getRoot());
+ if(project != null) {
+ try {
+ EclipseResourceUtil.removeNatureFromProject(project, IKbProject.NATURE_ID);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ }
return 0;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java 2009-05-14
15:50:04 UTC (rev 15254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java 2009-05-14
15:50:38 UTC (rev 15255)
@@ -17,6 +17,8 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.common.model.XModelConstants;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.project.JSFNature;
+import org.jboss.tools.jst.web.kb.IKbProject;
/**
*
@@ -33,7 +35,8 @@
writeXModel(project);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- EclipseResourceUtil.addNatureToProject(project,
"org.jboss.tools.jsf.jsfnature");
+ EclipseResourceUtil.addNatureToProject(project, JSFNature.NATURE_ID);
+ EclipseResourceUtil.addNatureToProject(project, IKbProject.NATURE_ID);
}
private void writeXModel(IProject project) {