Package com.sun.facelets

Examples of com.sun.facelets.Facelet.apply()


        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("component-client.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("4 children, the component", 4, root.getChildCount());
        assertNotNull("bound to map", map.get("c"));
    }
View Full Code Here


        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("defineInclude.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
View Full Code Here

       
        Company c = Example.createCompany();
        faces.getExternalContext().getRequestMap().put("company", c);
       
        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

         {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            URL url = SeamDebugPhaseListener.class.getClassLoader().getResource("META-INF/debug.xhtml");
            Facelet f = new DefaultFaceletFactory( new SAXCompiler(), new DefaultResourceResolver() ).getFacelet(url);
            UIViewRoot viewRoot = facesContext.getViewRoot();
            f.apply(facesContext, viewRoot);
            HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
            response.setCharacterEncoding("UTF-8");
            response.setContentType("text/html; UTF-8");
            ResponseWriter originalWriter = facesContext.getRenderKit().createResponseWriter( response.getWriter(), "text/html", "UTF-8" );
            StateWriterControl.initialize(originalWriter);
View Full Code Here

         try
         {
            URL url = SeamDebugPhaseListener.class.getClassLoader().getResource("META-INF/debug.xhtml");
            Facelet f = new DefaultFaceletFactory( new SAXCompiler(), new DefaultResourceResolver() ).getFacelet(url);
            UIViewRoot root = facesContext.getViewRoot();
            f.apply(facesContext, root);
            HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
            response.setContentType("text/html");
            ResponseWriter writer = facesContext.getRenderKit().createResponseWriter( response.getWriter(), "text/html", "UTF-8" );
            facesContext.setResponseWriter(writer);
            //root.renderAll();
View Full Code Here

        Facelet f = FaceletFactory.getInstance().getFacelet("elparser.xml");

        FacesContext faces = FacesContext.getCurrentInstance();

        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);

        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

        Facelet f = FaceletFactory.getInstance().getFacelet("selectOne.xml");

        FacesContext faces = FacesContext.getCurrentInstance();

        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        assertNotNull("target binding", target);
        assertEquals("children", 2, this.target.getChildCount());

        FastWriter fw = new FastWriter();
View Full Code Here

        Facelet f = FaceletFactory.getInstance().getFacelet("panelGrid.xml");

        FacesContext faces = FacesContext.getCurrentInstance();

        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        assertNotNull("target binding", target);
        assertEquals("children", 3, this.target.getChildCount());

        FastWriter fw = new FastWriter();
View Full Code Here

    FaceletFactory f = FaceletFactory.getInstance();
    Facelet at = f.getFacelet("/");

    UIViewRoot root = facesContext.getViewRoot();
    at.apply(facesContext, root);

    int count = root.getChildCount();
    assertTrue(count == 1);

    UIComponent dataTable = root.getChildren().get(0);
View Full Code Here

    FaceletFactory f = FaceletFactory.getInstance();
    Facelet at = f.getFacelet(viewId);

    UIViewRoot root = facesContext.getViewRoot();
    root.setViewId(viewId);
    at.apply(facesContext, root)
  }
 
  protected void preRenderView() throws Exception {
    StringBuilder builder = new StringBuilder("<script type='text/javascript'>");
    builder.append("DEFAULT_REQUEST_TIME = " + DEFAULT_REQUEST_TIME + ";");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.