[255287] Further enhancements to JSF integration with Library Provider Framework
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
index 4181a48..d727305 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
@@ -37,4 +37,7 @@
 extension-point.name.7 = customViewMapper
 extension-point.name.8 = Variable Resolver Ext Point
 extension-point.name.9 = AttributeValueRuntimeTypes
-extension-point.name.10 = JSF Tag Library Registry
\ No newline at end of file
+extension-point.name.10 = JSF Tag Library Registry
+
+noOpLibraryProviderWarning = Library configuration is disabled. Further classpath changes may be required later.
+noOpLibraryProviderMessage = This facet requires JSF implementation library to be present on project classpath. By disabling library configuration, user takes on responsibility of configuring classpath appropriately via alternate means.
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
index c72b6e1..fd56fe8 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
@@ -373,13 +373,15 @@
   </extension>
   
   <!--
-    *****************************
-    * JSF User Library Provider *
-    *****************************
+    ******************************************
+    * Library Provider Framework Integration *
+    ******************************************
   -->
   
   <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
     <provider id="jsf-user-library-provider" extends="wtp-user-library-provider">
+      <param name="validator" value="org.eclipse.jst.jsf.core.internal.project.facet.JSFLibraryValidator"/>
+      <param name="validator.param.0" value="javax.faces.FactoryFinder"/>
       <enablement>
         <with variable="requestingProjectFacet">
           <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.jsf" forcePluginActivation="true"/>
@@ -388,12 +390,18 @@
     </provider>
   </extension>
   
-  <!--
-    ******************************
-    * JSF Legacy Library Support *
-    ******************************
-  -->
-  
+  <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+    <provider id="jsf-no-op-library-provider" extends="no-op-library-provider">
+      <param name="message" value="%noOpLibraryProviderMessage"/>
+      <param name="warning" value="%noOpLibraryProviderWarning"/>
+      <enablement>
+        <with variable="requestingProjectFacet">
+          <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.jsf" forcePluginActivation="true"/>
+        </with>
+      </enablement>
+    </provider>
+  </extension>
+
   <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
     <provider id="legacy-jsf-library-provider" extends="legacy-library-provider" hidden="true">
       <action type="UNINSTALL">
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java
index 187cfff..b0fd7e5 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java
@@ -264,7 +264,11 @@
 	/**
 	 * see messages.properties
 	 */
-	public static String JSFFacetUninstallDelegate_NonUpdateableWebXML;
+	public static String JSFFacetUninstallDelegate_NonUpdateableWebXML;	
+	/**
+	 * see messages.properties
+	 */
+	public static String JSFLibraryValidator_MISSING_JSF_IMPLEMENTATION_CLASSES;
 
 	static {
 		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties
index 6bde11d..6014765 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties
@@ -17,6 +17,8 @@
 JSFLibraryRegistry_ErrorLoadingFromExtPt=Error while loading JSF Libraries from extension points
 JSFLibraryClasspathContainer_IMPL_LIBRARY=[JSF Library - implementation]
 
+JSFLibraryValidator_MISSING_JSF_IMPLEMENTATION_CLASSES=Selected libraries are missing key JSF implementation classes (javax.faces.*)
+
 JSFFacetInstallDataModelProvider_ValidateServletName=Specify a servlet name to use
 JSFLibraryConfigPersistData_SAVED_IMPLLIB_NOT_FOUND=Saved JSF implementation library in {0} is unavailable in JSF Library Registry
 JSFLibraryConfigPersistData_SAVED_COMPLIB_NOT_FOUND=Saved JSF component library in {0} is unavailable in JSF Library Registry
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFLibraryValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFLibraryValidator.java
new file mode 100644
index 0000000..4a9c7f7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFLibraryValidator.java
@@ -0,0 +1,27 @@
+package org.eclipse.jst.jsf.core.internal.project.facet;
+
+import static org.eclipse.jst.common.project.facet.core.internal.FacetedProjectFrameworkJavaPlugin.PLUGIN_ID;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.common.project.facet.core.libprov.user.KeyClassesValidator;
+import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.jsf.core.internal.Messages;
+
+/**
+ * Return custom message for JSF Libraries when KeyClassesValidator returns an error status
+ */
+public class JSFLibraryValidator extends KeyClassesValidator {
+
+	@Override
+	public IStatus validate(UserLibraryProviderInstallOperationConfig config) {
+		IStatus status = super.validate(config);
+		if (status.getSeverity() == IStatus.OK)
+			return status;
+		
+		String message = Messages.JSFLibraryValidator_MISSING_JSF_IMPLEMENTATION_CLASSES;
+		return new Status( IStatus.ERROR, PLUGIN_ID, message );
+
+	}
+
+}