### Eclipse Workspace Patch 1.0
#P org.jboss.tools.portlet.ui
Index: src/org/jboss/tools/portlet/ui/PortletUIActivator.java
===================================================================
--- src/org/jboss/tools/portlet/ui/PortletUIActivator.java	(revision 38345)
+++ src/org/jboss/tools/portlet/ui/PortletUIActivator.java	(working copy)
@@ -16,6 +16,7 @@
 import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -82,12 +83,20 @@
 	}
 	
 	public static IFile getPortletXmlFile(IProject project) {
+		try {
+			if (project == null || !project.hasNature(IModuleConstants.MODULE_NATURE_ID)) {
+				return null;
+			}
+		} catch (CoreException e) {
+			log(e);
+			return null;
+		}
 		IVirtualComponent component = ComponentCore.createComponent(project);
 		IVirtualFile portletVirtualFile = component.getRootFolder().getFile(
 				IPortletConstants.CONFIG_PATH);
 
 		if (!portletVirtualFile.getUnderlyingFile().exists()) {
-			log(new RuntimeException(Messages.PortletUIActivator_The_portlet_xml_file_doesnt_exist));
+			//log(new RuntimeException(Messages.PortletUIActivator_The_portlet_xml_file_doesnt_exist));
 			return null;
 		}
 
Index: src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java
===================================================================
--- src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java	(revision 38345)
+++ src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java	(working copy)
@@ -80,6 +80,8 @@
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
 import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.jboss.tools.portlet.core.IPortletConstants;
 import org.jboss.tools.portlet.ui.PortletUIActivator;
 
 /**
@@ -239,9 +241,7 @@
 	protected boolean isProjectValid(IProject project) {
 		boolean result;
 		try {
-			result = project.isAccessible() && 
-				project.hasNature(IModuleConstants.MODULE_NATURE_ID) && 
-			 	J2EEProjectUtilities.getJ2EEProjectType(project).equals(projectType);
+			return FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
 		} catch (CoreException ce) {
 			result = false;
 		}
Index: src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
===================================================================
--- src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java	(revision 38345)
+++ src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java	(working copy)
@@ -25,6 +25,7 @@
 import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.window.Window;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
 import org.eclipse.jst.j2ee.internal.war.ui.util.WebServletGroupItemProvider;
 import org.eclipse.jst.j2ee.internal.wizard.AnnotationsStandaloneGroup;
 import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage;
@@ -42,9 +43,11 @@
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
 import org.jboss.tools.portlet.core.IPortletConstants;
 import org.jboss.tools.portlet.ui.Messages;
 import org.jboss.tools.portlet.ui.MultiSelectFilteredFileSelectionDialog;
@@ -83,8 +86,7 @@
 	protected boolean isProjectValid(IProject project) {
 		boolean result;
 		try {
-			result = project.isAccessible() && 
-				project.hasNature(JavaCore.NATURE_ID);
+			return FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.PORTLET_FACET_ID);
 		} catch (CoreException ce) {
 			result = false;
 		}
