Package com.sun.facelets

Examples of com.sun.facelets.FaceletFactory


import com.sun.facelets.FaceletTestCase;

public class SelectTestCase extends FaceletTestCase {

  public void testSelectOne() throws Exception {
    FaceletFactory ff = FaceletFactory.getInstance();
    Facelet f = ff.getFacelet("selectOne.xml");
    this.servletRequest.getSession().setAttribute("test", new TestBean());
    this.servletRequest.setParameter("testForm:alignment", "10");
    FacesContext faces = FacesContext.getCurrentInstance();
    UIViewRoot root = new UIViewRoot();
    f.apply(faces, root);
View Full Code Here


public class UITestCase extends FaceletTestCase {

    public void testRelativePaths() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

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

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

    }
   
    public void testCompositionTemplate() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
View Full Code Here

    }
   
    public void testCompositionTemplateSimple() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template-simple.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
View Full Code Here

    public void testComponent() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
        Map map = new HashMap();
        faces.getExternalContext().getRequestMap().put("map", map);

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

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("only one child, the component", 1, root.getChildCount());
View Full Code Here

    public void testComponentClient() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
        Map map = new HashMap();
        faces.getExternalContext().getRequestMap().put("map", map);

        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());
View Full Code Here

public class DefineIncludeTestCase extends FaceletTestCase {

    public void testDefineInclude() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

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

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

 
  public void setUp() throws Exception {
    super.setUp();
    Compiler c = new SAXCompiler();
    //c.setTrimmingWhitespace(true);
    FaceletFactory factory = new DefaultFaceletFactory(c, this);
    FaceletFactory.setInstance(factory);

    facesContext.setViewRoot(facesContext.getApplication().getViewHandler().createView(facesContext, "/test"));

    ResponseWriter rw = facesContext.getRenderKit().createResponseWriter(new StringWriter(), null, null);
View Full Code Here

      c.add(i);
    }
    session.put("list", c);


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

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

    int count = root.getChildCount();
View Full Code Here

  }
 
  private static final Compiler compiler = new SAXCompiler();
 
  protected void buildView(String viewId) throws IOException {
    FaceletFactory factory = new DefaultFaceletFactory(compiler, createResourceResolver());
    FaceletFactory.setInstance(factory);

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

    UIViewRoot root = facesContext.getViewRoot();
    root.setViewId(viewId);
    at.apply(facesContext, root)
  }
View Full Code Here

TOP

Related Classes of com.sun.facelets.FaceletFactory

Copyright © 2018 www.massapicom. 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.