Package org.apache.myfaces.trinidad.component

Examples of org.apache.myfaces.trinidad.component.UIXPanel


    // "d" has children "e" and "f"
    // "c" has children "h" and "i"
    // Components "b" and "d" implement NamingContainer
    UIViewRoot a = new UIViewRoot(); a.setId("a");
    UIForm b = new UIForm(); b.setId("b");
    UIXPanel c = new UIXPanel(); c.setId("c");
    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
    UIXPanel e = new UIXPanel(); e.setId("e");
    UIXPanel f = new UIXPanel(); f.setId("f");
    UIXPanel g = new UIXPanel(); g.setId("g");
    UIXPanel h = new UIXPanel(); h.setId("h");
    UIXPanel i = new UIXPanel(); i.setId("i");
    a.getChildren().add(b);
    a.getChildren().add(c);
    b.getChildren().add(d);
    b.getChildren().add(g);
    c.getChildren().add(h);
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  public void testAddChild()
  {
    UIXPanel a = new UIXPanel();
    UIXPanel b = new UIXPanel();
    UIXPanel c = new UIXPanel();
    UIXPanel d = new UIXPanel();
    UIXPanel e = new UIXPanel();

    a.getChildren().add(b);
    a.getChildren().add(c);
    a.getFacets().put("dChild", d);

    assertEquals(b.getParent(), a);
    assertEquals(c.getParent(), a);
    assertEquals(d.getParent(), a);
    assertEquals(a.getChildren().get(0), b);
    assertEquals(a.getChildren().get(1), c);

    // Remove item 0, which had better be "b"
    a.getChildren().remove(0);
    assertEquals(b.getParent(), null);
    assertEquals(c.getParent(), a);
    assertEquals(a.getChildren().get(0), c);

    // Now add "d" to "e", and verify it's in "e", but not in "d"
    e.getChildren().add(d);
    assertEquals(null, a.getFacets().get("dChild"));
    assertEquals(e, d.getParent());
   
    // Now move "c" over to "e" too
    e.getChildren().add(c);
    assertEquals(0, a.getChildren().size());
    assertEquals(2, e.getChildren().size());
    assertEquals(e, c.getParent());

    //Make sure the children are in the right order under "e"
    assertEquals(e.getChildren().get(0), d);
    assertEquals(e.getChildren().get(1), c);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public void testAddFacet()
  {
    UIXPanel a = new UIXPanel();
    UIXPanel b = new UIXPanel();
    UIXPanel c = new UIXPanel();
    UIXPanel d = new UIXPanel();
    UIXPanel e = new UIXPanel();

    a.getChildren().add(b);
    a.getChildren().add(c);
    a.getFacets().put("dChild", d);

    // Now add "d" to "e", and verify it's in "e", but not in "d"
    e.getFacets().put("otherChild", d);
    assertEquals(null, a.getFacets().get("dChild"));
    assertEquals(e, d.getParent());
   
    // Now move "c" over to "e" too, and make sure it's gone from a.
    e.getFacets().put("otherOtherChild", c);
    assertEquals(e, c.getParent());
    assertEquals(1, a.getChildren().size());
    assertEquals(b, a.getChildren().get(0));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public void testMoveFromFacetToChild()
  {
    UIXPanel a = new UIXPanel();
    UIXPanel b = new UIXPanel();
    a.getChildren().add(b);

    a.getFacets().put("child", b);
    assertEquals(a, b.getParent());
    assertEquals(0, a.getChildren().size());
    assertEquals(b, a.getFacets().get("child"));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public void testMoveFromChildToFacet()
  {
    UIXPanel a = new UIXPanel();
    UIXPanel b = new UIXPanel();
    a.getFacets().put("child", b);


    a.getChildren().add(b);
    assertEquals(a, b.getParent());
    assertEquals(1, a.getChildren().size());
    assertEquals(b, a.getChildren().get(0));
    assertEquals(null, a.getFacets().get("child"));
  }
View Full Code Here

  public void testNested()
  {
    TestNamingContainer a = new TestNamingContainer(); a.setId("a");
    TestNamingContainer b = new TestNamingContainer(); b.setId("b");
    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
    UIXPanel e = new UIXPanel(); e.setId("e");
    UIXPanel g = new UIXPanel(); g.setId("g");
    a.getChildren().add(b);
    b.getChildren().add(d);
    b.getChildren().add(g);
    d.getChildren().add(e);
   
View Full Code Here

    // "d" has children "e" and "f"
    // "c" has children "h" and "i"
    // Components "b" and "d" implement NamingContainer
    UIViewRoot a = new UIViewRoot(); a.setId("a");
    UIForm b = new UIForm(); b.setId("b");
    UIXPanel c = new UIXPanel(); c.setId("c");
    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
    UIXPanel e = new UIXPanel(); e.setId("e");
    UIXPanel f = new UIXPanel(); f.setId("f");
    UIXPanel g = new UIXPanel(); g.setId("g");
    UIXPanel h = new UIXPanel(); h.setId("h");
    UIXPanel i = new UIXPanel(); i.setId("i");
    a.getChildren().add(b);
    a.getChildren().add(c);
    b.getChildren().add(d);
    b.getChildren().add(g);
    c.getChildren().add(h);
    c.getChildren().add(i);
    d.getChildren().add(e);
    d.getChildren().add(f);
   
    // Positive relative searches from "a"
    assertTrue(a == a.findComponent("a"));
    assertTrue(b == a.findComponent("b"));
    assertTrue(c == a.findComponent("c"));
    assertTrue(d == a.findComponent("b:d"));
    assertTrue(e == a.findComponent("b:d:e"));
    assertTrue(f == a.findComponent("b:d:f"));
    assertTrue(g == a.findComponent("b:g"));
    assertTrue(h == a.findComponent("h"));
    assertTrue(i == a.findComponent("i"));
   
    // Negative relative searches from "a"
    assertNull(a.findComponent("d"));
    assertNull(a.findComponent("e"));
    assertNull(a.findComponent("f"));
    assertNull(a.findComponent("g"));
   
    // Positive relative searches from "b"
    assertTrue(b == b.findComponent("b"));
    assertTrue(d == b.findComponent("d"));
    assertTrue(e == b.findComponent("d:e"));
    assertTrue(f == b.findComponent("d:f"));
    assertTrue(g == b.findComponent("g"));
   
    // Negative relative searches from "b"
    assertNull(b.findComponent("a"));
    assertNull(b.findComponent("c"));
    assertNull(b.findComponent("e"));
    assertNull(b.findComponent("f"));
    assertNull(b.findComponent("h"));
    assertNull(b.findComponent("i"));
   
    // Positive relative searches from "c"
    assertTrue(a == c.findComponent("a"));
    assertTrue(b == c.findComponent("b"));
    assertTrue(c == c.findComponent("c"));
    assertTrue(d == c.findComponent("b:d"));
    assertTrue(e == c.findComponent("b:d:e"));
    assertTrue(f == c.findComponent("b:d:f"));
    assertTrue(g == c.findComponent("b:g"));
    assertTrue(h == c.findComponent("h"));
    assertTrue(i == c.findComponent("i"));
   
    // Negative relative searches from "c"
    assertNull(c.findComponent("d"));
    assertNull(c.findComponent("e"));
    assertNull(c.findComponent("f"));
    assertNull(c.findComponent("g"));
   
    // Positive relative searches from "d"
    assertTrue(d == d.findComponent("d"));
    assertTrue(e == d.findComponent("e"));
    assertTrue(f == d.findComponent("f"));
   
    // Negative relative searches from "d"
    assertNull(d.findComponent("a"));
    assertNull(d.findComponent("b"));
    assertNull(d.findComponent("c"));
    assertNull(d.findComponent("g"));
    assertNull(d.findComponent("h"));
    assertNull(d.findComponent("i"));
   
    // Positive relative searches from "e"
    assertTrue(d == e.findComponent("d"));
    assertTrue(e == e.findComponent("e"));
    assertTrue(f == e.findComponent("f"));
   
    // Negative relative searches from "e"
    assertNull(e.findComponent("a"));
    assertNull(e.findComponent("b"));
    assertNull(e.findComponent("c"));
    assertNull(e.findComponent("g"));
    assertNull(e.findComponent("h"));
    assertNull(e.findComponent("i"));
   
    // Positive relative searches from "f"
    assertTrue(d == f.findComponent("d"));
    assertTrue(e == f.findComponent("e"));
    assertTrue(f == f.findComponent("f"));
   
    // Negative relative searches from "f"
    assertNull(f.findComponent("a"));
    assertNull(f.findComponent("b"));
    assertNull(f.findComponent("c"));
    assertNull(f.findComponent("g"));
    assertNull(f.findComponent("h"));
    assertNull(f.findComponent("i"));
   
    // Positive relative searches from "g"
    assertTrue(b == g.findComponent("b"));
    assertTrue(d == g.findComponent("d"));
    assertTrue(e == g.findComponent("d:e"));
    assertTrue(f == g.findComponent("d:f"));
    assertTrue(g == g.findComponent("g"));
   
    // Negative relative searches from "g"
    assertNull(g.findComponent("a"));
    assertNull(g.findComponent("c"));
    assertNull(g.findComponent("e"));
    assertNull(g.findComponent("f"));
    assertNull(g.findComponent("h"));
    assertNull(g.findComponent("i"));
   
    // Positive relative searches from "h"
    assertTrue(a == h.findComponent("a"));
    assertTrue(b == h.findComponent("b"));
    assertTrue(c == h.findComponent("c"));
    assertTrue(d == h.findComponent("b:d"));
    assertTrue(e == h.findComponent("b:d:e"));
    assertTrue(f == h.findComponent("b:d:f"));
    assertTrue(g == h.findComponent("b:g"));
    assertTrue(h == h.findComponent("h"));
    assertTrue(i == h.findComponent("i"));
   
    // Negative relative searches from "h"
    assertNull(h.findComponent("d"));
    assertNull(h.findComponent("e"));
    assertNull(h.findComponent("f"));
    assertNull(h.findComponent("g"));
   
    // Positive relative searches from "i"
    assertTrue(a == i.findComponent("a"));
    assertTrue(b == i.findComponent("b"));
    assertTrue(c == i.findComponent("c"));
    assertTrue(d == i.findComponent("b:d"));
    assertTrue(e == i.findComponent("b:d:e"));
    assertTrue(f == i.findComponent("b:d:f"));
    assertTrue(g == i.findComponent("b:g"));
    assertTrue(h == i.findComponent("h"));
    assertTrue(i == i.findComponent("i"));
   
    // Negative relative searches from "i"
    assertNull(i.findComponent("d"));
    assertNull(i.findComponent("e"));
    assertNull(i.findComponent("f"));
    assertNull(i.findComponent("g"));
   
    // Absolute searches from "a"
    assertTrue(a == a.findComponent(":a"));
    assertTrue(b == a.findComponent(":b"));
    assertTrue(c == a.findComponent(":c"));
    assertTrue(d == a.findComponent(":b:d"));
    assertTrue(e == a.findComponent(":b:d:e"));
    assertTrue(f == a.findComponent(":b:d:f"));
    assertTrue(g == a.findComponent(":b:g"));
    assertTrue(h == a.findComponent(":h"));
    assertTrue(i == a.findComponent(":i"));
   
    // Absolute searches from "b"
    assertTrue(a == b.findComponent(":a"));
    assertTrue(b == b.findComponent(":b"));
    assertTrue(c == b.findComponent(":c"));
    assertTrue(d == b.findComponent(":b:d"));
    assertTrue(e == b.findComponent(":b:d:e"));
    assertTrue(f == b.findComponent(":b:d:f"));
    assertTrue(g == b.findComponent(":b:g"));
    assertTrue(h == b.findComponent(":h"));
    assertTrue(i == b.findComponent(":i"));
   
    // Absolute searches from "c"
    assertTrue(a == c.findComponent(":a"));
    assertTrue(b == c.findComponent(":b"));
    assertTrue(c == c.findComponent(":c"));
    assertTrue(d == c.findComponent(":b:d"));
    assertTrue(e == c.findComponent(":b:d:e"));
    assertTrue(f == c.findComponent(":b:d:f"));
    assertTrue(g == c.findComponent(":b:g"));
    assertTrue(h == c.findComponent(":h"));
    assertTrue(i == c.findComponent(":i"));
   
    // Absolute searches from "d"
    assertTrue(a == d.findComponent(":a"));
    assertTrue(b == d.findComponent(":b"));
    assertTrue(c == d.findComponent(":c"));
    assertTrue(d == d.findComponent(":b:d"));
    assertTrue(e == d.findComponent(":b:d:e"));
    assertTrue(f == d.findComponent(":b:d:f"));
    assertTrue(g == d.findComponent(":b:g"));
    assertTrue(h == d.findComponent(":h"));
    assertTrue(i == d.findComponent(":i"));
   
    // Absolute searches from "e"
    assertTrue(a == e.findComponent(":a"));
    assertTrue(b == e.findComponent(":b"));
    assertTrue(c == e.findComponent(":c"));
    assertTrue(d == e.findComponent(":b:d"));
    assertTrue(e == e.findComponent(":b:d:e"));
    assertTrue(f == e.findComponent(":b:d:f"));
    assertTrue(g == e.findComponent(":b:g"));
    assertTrue(h == e.findComponent(":h"));
    assertTrue(i == e.findComponent(":i"));
   
    // Absolute searches from "f"
    assertTrue(a == f.findComponent(":a"));
    assertTrue(b == f.findComponent(":b"));
    assertTrue(c == f.findComponent(":c"));
    assertTrue(d == f.findComponent(":b:d"));
    assertTrue(e == f.findComponent(":b:d:e"));
    assertTrue(f == f.findComponent(":b:d:f"));
    assertTrue(g == f.findComponent(":b:g"));
    assertTrue(h == f.findComponent(":h"));
    assertTrue(i == f.findComponent(":i"));
   
    // Absolute searches from "g"
    assertTrue(a == g.findComponent(":a"));
    assertTrue(b == g.findComponent(":b"));
    assertTrue(c == g.findComponent(":c"));
    assertTrue(d == g.findComponent(":b:d"));
    assertTrue(e == g.findComponent(":b:d:e"));
    assertTrue(f == g.findComponent(":b:d:f"));
    assertTrue(g == g.findComponent(":b:g"));
    assertTrue(h == g.findComponent(":h"));
    assertTrue(i == g.findComponent(":i"));
   
    // Absolute searches from "h"
    assertTrue(a == h.findComponent(":a"));
    assertTrue(b == h.findComponent(":b"));
    assertTrue(c == h.findComponent(":c"));
    assertTrue(d == h.findComponent(":b:d"));
    assertTrue(e == h.findComponent(":b:d:e"));
    assertTrue(f == h.findComponent(":b:d:f"));
    assertTrue(g == h.findComponent(":b:g"));
    assertTrue(h == h.findComponent(":h"));
    assertTrue(i == h.findComponent(":i"));
   
    // Absolute searches from "i"
    assertTrue(a == i.findComponent(":a"));
    assertTrue(b == i.findComponent(":b"));
    assertTrue(c == i.findComponent(":c"));
    assertTrue(d == i.findComponent(":b:d"));
    assertTrue(e == i.findComponent(":b:d:e"));
    assertTrue(f == i.findComponent(":b:d:f"));
    assertTrue(g == i.findComponent(":b:g"));
    assertTrue(h == i.findComponent(":h"));
    assertTrue(i == i.findComponent(":i"));
  }
View Full Code Here

    // "d" has children "e" and "f"
    // "c" has children "h" and "i"
    // Components "b" and "d" implement NamingContainer
    UIViewRoot a = new UIViewRoot(); a.setId("a");
    UIForm b = new UIForm(); b.setId("b");
    UIXPanel c = new UIXPanel(); c.setId("c");
    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
    UIXPanel e = new UIXPanel(); e.setId("e");
    UIXPanel f = new UIXPanel(); f.setId("f");
    UIXPanel g = new UIXPanel(); g.setId("g");
    UIXPanel h = new UIXPanel(); h.setId("h");
    UIXPanel i = new UIXPanel(); i.setId("i");
    a.getChildren().add(b);
    a.getChildren().add(c);
    b.getChildren().add(d);
    b.getChildren().add(g);
    c.getChildren().add(h);
    c.getChildren().add(i);
    d.getChildren().add(e);
    d.getChildren().add(f);
       
    // Absolute searches from "a"
    assertTrue(a == a.findComponent(":a"));
    assertTrue(b == a.findComponent(":b"));
    assertTrue(c == a.findComponent(":c"));
    assertTrue(d == a.findComponent(":b:d"));
    assertTrue(e == a.findComponent(":b:d:e"));
    assertTrue(f == a.findComponent(":b:d:f"));
    assertTrue(g == a.findComponent(":b:g"));
    assertTrue(h == a.findComponent(":h"));
    assertTrue(i == a.findComponent(":i"));
   
    // Absolute searches from "b"
    assertTrue(a == b.findComponent(":a"));
    assertTrue(b == b.findComponent(":b"));
    assertTrue(c == b.findComponent(":c"));
    assertTrue(d == b.findComponent(":b:d"));
    assertTrue(e == b.findComponent(":b:d:e"));
    assertTrue(f == b.findComponent(":b:d:f"));
    assertTrue(g == b.findComponent(":b:g"));
    assertTrue(h == b.findComponent(":h"));
    assertTrue(i == b.findComponent(":i"));
   
    // Absolute searches from "c"
    assertTrue(a == c.findComponent(":a"));
    assertTrue(b == c.findComponent(":b"));
    assertTrue(c == c.findComponent(":c"));
    assertTrue(d == c.findComponent(":b:d"));
    assertTrue(e == c.findComponent(":b:d:e"));
    assertTrue(f == c.findComponent(":b:d:f"));
    assertTrue(g == c.findComponent(":b:g"));
    assertTrue(h == c.findComponent(":h"));
    assertTrue(i == c.findComponent(":i"));
   
    // Absolute searches from "d"
    assertTrue(a == d.findComponent(":a"));
    assertTrue(b == d.findComponent(":b"));
    assertTrue(c == d.findComponent(":c"));
    assertTrue(d == d.findComponent(":b:d"));
    assertTrue(e == d.findComponent(":b:d:e"));
    assertTrue(f == d.findComponent(":b:d:f"));
    assertTrue(g == d.findComponent(":b:g"));
    assertTrue(h == d.findComponent(":h"));
    assertTrue(i == d.findComponent(":i"));
   
    // Absolute searches from "e"
    assertTrue(a == e.findComponent(":a"));
    assertTrue(b == e.findComponent(":b"));
    assertTrue(c == e.findComponent(":c"));
    assertTrue(d == e.findComponent(":b:d"));
    assertTrue(e == e.findComponent(":b:d:e"));
    assertTrue(f == e.findComponent(":b:d:f"));
    assertTrue(g == e.findComponent(":b:g"));
    assertTrue(h == e.findComponent(":h"));
    assertTrue(i == e.findComponent(":i"));
   
    // Absolute searches from "f"
    assertTrue(a == f.findComponent(":a"));
    assertTrue(b == f.findComponent(":b"));
    assertTrue(c == f.findComponent(":c"));
    assertTrue(d == f.findComponent(":b:d"));
    assertTrue(e == f.findComponent(":b:d:e"));
    assertTrue(f == f.findComponent(":b:d:f"));
    assertTrue(g == f.findComponent(":b:g"));
    assertTrue(h == f.findComponent(":h"));
    assertTrue(i == f.findComponent(":i"));
   
    // Absolute searches from "g"
    assertTrue(a == g.findComponent(":a"));
    assertTrue(b == g.findComponent(":b"));
    assertTrue(c == g.findComponent(":c"));
    assertTrue(d == g.findComponent(":b:d"));
    assertTrue(e == g.findComponent(":b:d:e"));
    assertTrue(f == g.findComponent(":b:d:f"));
    assertTrue(g == g.findComponent(":b:g"));
    assertTrue(h == g.findComponent(":h"));
    assertTrue(i == g.findComponent(":i"));
   
    // Absolute searches from "h"
    assertTrue(a == h.findComponent(":a"));
    assertTrue(b == h.findComponent(":b"));
    assertTrue(c == h.findComponent(":c"));
    assertTrue(d == h.findComponent(":b:d"));
    assertTrue(e == h.findComponent(":b:d:e"));
    assertTrue(f == h.findComponent(":b:d:f"));
    assertTrue(g == h.findComponent(":b:g"));
    assertTrue(h == h.findComponent(":h"));
    assertTrue(i == h.findComponent(":i"));
   
    // Absolute searches from "i"
    assertTrue(a == i.findComponent(":a"));
    assertTrue(b == i.findComponent(":b"));
    assertTrue(c == i.findComponent(":c"));
    assertTrue(d == i.findComponent(":b:d"));
    assertTrue(e == i.findComponent(":b:d:e"));
    assertTrue(f == i.findComponent(":b:d:f"));
    assertTrue(g == i.findComponent(":b:g"));
    assertTrue(h == i.findComponent(":h"));
    assertTrue(i == i.findComponent(":i"));
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.UIXPanel

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.