Package org.apache.wicket

Examples of org.apache.wicket.MarkupContainer


      }
      else
      {
        while (rows.hasNext())
        {
          MarkupContainer row = rows.next();

          final Iterator<? extends Component> rawCells;
          rawCells = ((MarkupContainer)row.iterator().next()).iterator();
          cells = Generics.iterator(rawCells);
          if (cells.hasNext())
          {
            next = cells.next();
            break;
View Full Code Here


    this.tree = tree;

    setOutputMarkupId(true);

    MarkupContainer junction = createJunctionComponent("junction");
    junction.add(new StyleBehavior());
    add(junction);

    Component content = createContent(CONTENT_ID, model);
    if (!content.getId().equals(CONTENT_ID))
    {
View Full Code Here

  public boolean matches(Component component)
  {
    // alleen markupcontainers hebben kinderen
    if (component instanceof MarkupContainer)
    {
      MarkupContainer container = (MarkupContainer) component;
      ChildMatchingVisitor visitor = new ChildMatchingVisitor();
      container.visitChildren(visitor);
      return visitor.matches;
    }
    return false;
  }
View Full Code Here

     * @param component
     */
    private void associateLabelToFormComponents(final ElementMetaData propertyMeta, Component component)
    {
        if (component instanceof MarkupContainer) {
            MarkupContainer container = (MarkupContainer)component;
            container.visitChildren(FormComponent.class, new IVisitor<Component>() {
                public Object component(Component component)
                {
                    FormComponent formComponent = (FormComponent)component;
                    formComponent.setLabel( new Model(propertyMeta.getLabel()) );
                    formComponent.add( new ErrorHighlightingBehavior() );
View Full Code Here

    }

    private void refreshComponent(final AjaxRequestTarget target, Component targetComponent)
    {
        // Refresh this field. We have to find the parent Field to do this.
        MarkupContainer field;
        if (targetComponent instanceof Field) {
            field = (MarkupContainer)targetComponent;
        }
        else {
            field = targetComponent.findParent(AbstractField.class);
        }
       
        if (field != null) {
            if (!field.getRenderBodyOnly()) {
                target.addComponent(field);
            }
            else {
                // Field is RenderBodyOnly, have to add children individually
                field.visitChildren( new IVisitor<Component>() {
                    public Object component(Component component)
                    {
                        if (!component.getRenderBodyOnly()) {
                            target.addComponent(component);
                        }
View Full Code Here

  {
    super(id, model);

    this.tree = tree;

    MarkupContainer junction = createJunctionComponent("junction");
    junction.add(new StyleBehavior());
    add(junction);

    Component content = createContent(CONTENT_ID, model);
    if (!content.getId().equals(CONTENT_ID))
    {
View Full Code Here

      for (Component child : this)
      {
        if (child instanceof MarkupContainer)
        {
          dequeue.popContainer(); // pop the repeater
          MarkupContainer container = (MarkupContainer) child;
          dequeue.pushContainer(container);
          container.dequeue(dequeue);
          dequeue.restore(bookmark);
        }
      }
    }
View Full Code Here

   *
   * @return enclosure's parent markup container
   */
  protected MarkupContainer getEnclosureParent()
  {
    MarkupContainer parent = getParent();
    while ((parent != null) && parent.isAuto())
    {
      parent = parent.getParent();
    }

    if (parent == null)
    {
      throw new WicketRuntimeException(
View Full Code Here

   * @throws Exception
   */
  @Test
  public void webMarkupContainer() throws Exception
  {
    MarkupContainer container = (MarkupContainer)new MyPage().get("container");
    IMarkupFragment markup = container.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"container\">text</span>");

    // The container doesn't have an external markup file
    markup = container.getAssociatedMarkup();
    assertNull(markup);

    // Get the markup which is used to search for children.
    markup = container.getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"container\">text</span>");
  }
View Full Code Here

    RequestCycle requestCycle = RequestCycle.get();

    final Response originalResponse = requestCycle.getResponse();
    BufferedWebResponse tempResponse = new BufferedWebResponse(null);

    MarkupContainer oldParent = component.getParent();

    try
    {
      requestCycle.setResponse(tempResponse);

      // add the component to a dummy page just for the rendering
      RenderPage page = new RenderPage(component);
      page.internalInitialize();

      component.render();
    }
    finally
    {
      if (oldParent != null)
      {
        oldParent.add(component); // re-add the child to its old parent
      }

      requestCycle.setResponse(originalResponse);
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.MarkupContainer

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.