View Javadoc

1   /*
2    * $Id: FaceletViewHandler.java,v 1.3 2007/09/13 08:38:13 oeuillot Exp $
3    */
4   package org.rcfaces.core.internal.facelets;
5   
6   import java.io.IOException;
7   
8   import javax.faces.application.ViewHandler;
9   import javax.faces.component.UIViewRoot;
10  import javax.faces.context.FacesContext;
11  
12  import org.apache.commons.logging.Log;
13  import org.apache.commons.logging.LogFactory;
14  
15  /**
16   * 
17   * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
18   * @version $Revision: 1.3 $ $Date: 2007/09/13 08:38:13 $
19   */
20  public class FaceletViewHandler extends com.sun.facelets.FaceletViewHandler {
21      private static final String REVISION = "$Revision: 1.3 $";
22  
23      private static final Log LOG = LogFactory.getLog(FaceletViewHandler.class);
24  
25      public FaceletViewHandler(ViewHandler parent) {
26          super(parent);
27      }
28  
29      public void buildFaceletViewRoot(FacesContext facesContext,
30              UIViewRoot viewRoot) throws IOException {
31          buildView(facesContext, viewRoot);
32      }
33  
34      public static boolean isFaceletProcessor(FacesContext context) {
35          if (context.getApplication().getViewHandler() instanceof FaceletViewHandler) {
36              LOG.debug("Facelet processor detected");
37              return true;
38          }
39  
40          LOG.debug("Facelet processor not detected");
41          return false;
42      }
43  }