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

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


    Form form = (Form)findParent(Form.class);
    if (form == null)
    {
      // check whether the form is a child of a surrounding border
      final Border border = (Border)findParent(Border.class);
      if (border != null)
      {
        FindFormVisitor formVisitor = new FindFormVisitor();
        border.visitChildren(Form.class, formVisitor);
        form = formVisitor.form;
      }
      if (form == null)
      {
        throw new WicketRuntimeException("Could not find Form parent for " + this);
View Full Code Here


  /**
   * Construct.
   */
  public AjaxLinkWithBorderPage()
  {
    Border border = new AjaxTestBorder("border");
    add(border);

    final Label label = new Label("ajaxLabel", new PropertyModel<String>(this, "labelText"));
    label.setOutputMarkupId(true);
    border.add(label);
    border.add(new AjaxLink<Void>("ajaxLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target)
View Full Code Here

            }
          }

          // Check if this component is a child of a border whose body is invisible and if
          // so ignore it
          Border border = component.findParent(Border.class);
          if (border != null && !border.getBodyContainer().isVisibleInHierarchy())
          {
            // Suppose:
            //
            // <div wicket:id="border"><div wicket:id="label"></div> suppose
            // border->label and border's body is hidden.
View Full Code Here

  /**
   * Construct.
   */
  public EnclosurePage_3()
  {
    Border border = new MyBorder("border");
    add(border);

    border.add(new Link<Void>("newLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick()
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());

    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()
    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

   * @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

        return output.toString().toUpperCase();
      }
    };

    add(borderContainer);
    Border border = new SimpleBorder("myBorder");
    borderContainer.add(border);

    Border border2 = new SimpleBorder("myBorder2");
    border2.setRenderBodyOnly(false);
    border2.add(AttributeModifier.replace("testAttr", "myValue"));
    add(border2);

    border2.add(new XsltTransformerBehavior());
  }
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

TOP

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

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.