Package org.apache.wicket.markup.html.border

Examples of org.apache.wicket.markup.html.border.Border$BorderBodyContainer


   * @throws ResourceStreamNotFoundException
   */
  @Test
  public void parseBorderSintax() throws IOException, ResourceStreamNotFoundException
  {
    tester.getApplication().getPageSettings().addComponentResolver(new Border("test_resolver")
    {
      /**
       *
       */
      private static final long serialVersionUID = 1L;
View Full Code Here


   */
  @Test
  public void border() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareMarkupWithFile(markup, "MyBorder_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compareMarkupWithString(markup, "<wicket:border>  111  <wicket:body/>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    border.dequeue();
    markup = border.getBodyContainer().getMarkup();
    compareMarkupWithString(markup, "<wicket:body/>");

    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");

    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compareMarkupWithString(markup, "<wicket:body/>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");
  }
View Full Code Here

   */
  @Test
  public void border2() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border2");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareMarkupWithFile(markup, "MyBorder2_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"border2\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compareMarkupWithString(markup,
      "<wicket:border>  111  <wicket:body>333</wicket:body>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    // See explanation in BaseBorder.BorderBodyContainer.getMarkup()
    border.dequeue();
    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compareMarkupWithString(markup, "<wicket:body>333</wicket:body>");

    markup = border.getBodyContainer().getMarkup();
    compareMarkupWithString(markup, "<wicket:body>333</wicket:body>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border2\">test</span>");
  }
View Full Code Here

  @Test
  public void border_nested()
  {
    MarkupContainer a = new A(), b = new B(), c= new C(), d = new D(), r = new R(), s = new S();

    Border outerBorder = new OuterBorder("outerBorder");

    Border innerBorder = new InnerBorder("innerBorder");

    outerBorder.queueToBorder(r, innerBorder);

    innerBorder.queueToBorder(c, d);

    outerBorder.queueToBorder(s);


    TestPage p = new TestPage();
    p.setPageMarkup("<p wicket:id='a'><p wicket:id='outerBorder'><p wicket:id='b'></p></p></p>");
   
    p.queue(b, outerBorder, a);

    tester.startPage(p);
   
    assertThat(p, hasPath(new Path(a, outerBorder,  r, innerBorder, c, d, innerBorder.getBodyContainer(), s)));
    assertThat(p, hasPath(new Path(a, outerBorder, r, outerBorder.getBodyContainer(), b)));
  }
View Full Code Here

   * @throws ResourceStreamNotFoundException
   */
  @Test
  public void parseBorderSintax() throws IOException, ResourceStreamNotFoundException
  {
    tester.getApplication().getPageSettings().addComponentResolver(new Border("test_resolver")
    {
      /**
       *
       */
      private static final long serialVersionUID = 1L;
View Full Code Here

    label = (Label)tester.getLastRenderedPage().get("myPanel:label");
    assertNotNull(label);
    assertFalse("".equals(document));
    assertTrue(document.contains("<span wicket:id=\"label\">mein Label</span>"));

    Border border = (Border)tester.getLastRenderedPage().get("myBorder");
    assertNotNull(border);
    assertFalse("".equals(document));
    assertTrue(document.contains("<wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border>"));

    border = (Border)tester.getLastRenderedPage().get("myBorder2");
View Full Code Here

    label = (Label)page.get("myPanel:label");
    assertNotNull(label);
    assertTrue(document.contains("<span wicket:id=\"label\">mein Label</span>"));

    Border border = (Border)page.get("myBorder");
    assertNotNull(border);
    assertTrue(document.contains("<wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border>"));

    border = (Border)page.get("myBorder2");
    assertNotNull(border);
View Full Code Here

    assertNotNull(label);
    attr = label.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("label", attr.getString("wicket:id"));

    Border border = (Border)page.get("myBorder");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder", attr.getString("wicket:id"));

    border = (Border)page.get("myBorder2");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder2", attr.getString("wicket:id"));

    // do the same test twice. Igor reported a problem with that, so we have to test it.
    border = (Border)page.get("myBorder2");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder2", attr.getString("wicket:id"));

    WebMarkupContainer container = (WebMarkupContainer)page.get("test");
    assertNotNull(container);
View Full Code Here

    Form<?> form = component.findParent(Form.class);
    if (form == null)
    {
      // check whether the form is a child of a surrounding border
      Border border = component.findParent(Border.class);
      while ((form == null) && (border != null))
      {
        FindFormVisitor formVisitor = new FindFormVisitor();
        border.visitChildren(Form.class, formVisitor);
        form = formVisitor.form;
        if (form == null)
        {
          border = border.findParent(Border.class);
        }
      }
    }
    return form;
View Full Code Here

    label = (Label)tester.getLastRenderedPage().get("myPanel:label");
    assertNotNull(label);
    assertFalse("".equals(document));
    assertTrue(document.contains("<span wicket:id=\"label\">mein Label</span>"));

    Border border = (Border)tester.getLastRenderedPage().get("myBorder");
    assertNotNull(border);
    assertFalse("".equals(document));
    assertTrue(document.contains("<wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border>"));

    border = (Border)tester.getLastRenderedPage().get("myBorder2");
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.border.Border$BorderBodyContainer

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.