Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.ComponentTag


        while (markupStream.hasMore())
        {
          markupStream.next();
          if (markupStream.skipUntil(ComponentTag.class))
          {
            ComponentTag tag = markupStream.getTag();
            if ((tag != null) && (tag.isOpen() || tag.isOpenClose()))
            {
              if (childId.equals(tag.getId()))
              {
                controller = ComponentResolvers.resolve(container, markupStream,
                  tag, new ResolverFilter()
                  {
                    public boolean ignoreResolver(
View Full Code Here


      }

      // Get the <span wicket:id="myBorder"> markup and render that instead
      IMarkupFragment markup = Border.this.getMarkup();
      MarkupStream stream = new MarkupStream(markup);
      ComponentTag tag = stream.getTag();
      stream.next();

      super.onComponentTagBody(stream, tag);
    }
View Full Code Here

      // Skip <wicket:border>
      stream.next();

      while (stream.skipUntil(ComponentTag.class))
      {
        ComponentTag tag = stream.getTag();
        if (tag.isOpen() || tag.isOpenClose())
        {
          if (TagUtils.isWicketBodyTag(tag))
          {
            return stream.getMarkupFragment();
          }
View Full Code Here

  {
    super.onComponentTagBody(component, markupStream, openTag);

    // Get the fragments open tag
    MarkupStream stream = new MarkupStream(getMarkup((MarkupContainer)component, null));
    ComponentTag fragmentOpenTag = stream.getTag();

    // if it is an open close tag, skip this fragment.
    if (!fragmentOpenTag.isOpenClose())
    {
      // We'll completely ignore the fragments open tag. It'll not be
      // rendered
      stream.next();
View Full Code Here

    // Find the markup fragment
    MarkupStream stream = new MarkupStream(markup);
    IMarkupFragment headerMarkup = null;
    while (stream.skipUntil(ComponentTag.class) && (headerMarkup == null))
    {
      ComponentTag tag = stream.getTag();
      if (tag.isOpen() || tag.isOpenClose())
      {
        if (tag instanceof WicketTag)
        {
          WicketTag wtag = (WicketTag)tag;
          if (wtag.isHeadTag())
          {
            if (tag.getMarkupClass() == null)
            {
              headerMarkup = stream.getMarkupFragment();
            }
          }
        }
        else if (tag.getName().equalsIgnoreCase("head"))
        {
          headerMarkup = stream.getMarkupFragment();
        }
      }
View Full Code Here

      associatedMarkupStream.throwMarkupException("Expected the open tag. " +
        exceptionMessage);
    }

    // Check for required open tag name
    ComponentTag associatedMarkupOpenTag = (ComponentTag)elem;
    if (!((associatedMarkupOpenTag != null) && associatedMarkupOpenTag.isOpen() && (associatedMarkupOpenTag instanceof WicketTag)))
    {
      associatedMarkupStream.throwMarkupException(exceptionMessage);
    }

    try
View Full Code Here

    // If it's a tag like <wicket..> or <span wicket:id="..." >
    if ((element instanceof ComponentTag) && !markupStream.atCloseTag())
    {
      // Get element as tag
      final ComponentTag tag = (ComponentTag)element;

      // Get component id
      final String id = tag.getId();

      // Get the component for the id from the given container
      Component component = get(id);
      if (component == null)
      {
        component = ComponentResolvers.resolve(this, markupStream, tag, null);
        if ((component != null) && (component.getParent() == null))
        {
          autoAdd(component, markupStream);
        }
        else if (component != null)
        {
          component.setMarkup(markupStream.getMarkupFragment());
        }
      }

      // Failed to find it?
      if (component != null)
      {
        component.render();
      }
      else if (tag.getFlag(ComponentTag.RENDER_RAW))
      {
        // No component found, but "render as raw markup" flag found
        getResponse().write(element.toCharSequence());
        return true;
      }
      else
      {
        if (tag instanceof WicketTag)
        {
          if (((WicketTag)tag).isChildTag())
          {
            markupStream.throwMarkupException("Found " + tag.toString() +
              " but no <wicket:extend>. Container: " + toString());
          }
          else
          {
            markupStream.throwMarkupException("Failed to handle: " +
              tag.toString() +
              ". It might be that no resolver has been registered to handle this special tag. " +
              " But it also could be that you declared wicket:id=" + id +
              " in your markup, but that you either did not add the " +
              "component to your page at all, or that the hierarchy does not match. " +
              "Container: " + toString());
View Full Code Here

  {
    if ((markupStream != null) && (markupStream.getCurrentIndex() > 0))
    {
      // If the original tag has been changed from open-close to open-body-close, than we are
      // done. Other components, e.g. BorderBody, rely on this method being called.
      ComponentTag origOpenTag = (ComponentTag)markupStream.get(markupStream.getCurrentIndex() - 1);
      if (origOpenTag.isOpenClose())
      {
        return;
      }
    }
View Full Code Here

      }

      // Search for <wicket:xxx> in the remaining markup and try to resolve the component
      while (stream.skipUntil(ComponentTag.class))
      {
        ComponentTag tag = stream.getTag();
        if (tag.isOpen() || tag.isOpenClose())
        {
          if (tag instanceof WicketTag)
          {
            Component component = ComponentResolvers.resolve(this, stream, tag, null);
            if ((component != null) && (component.getParent() == null))
            {
              if (component.getId().equals(tag.getId()) == false)
              {
                // make sure we are able to get() the component during rendering
                tag.setId(component.getId());
                tag.setModified(true);
              }
              add(component);
            }
          }

          if (tag.isOpen())
          {
            stream.skipToMatchingCloseTag(tag);
          }
        }
        stream.next();
View Full Code Here

            }
          };
        }
      };

      ComponentTag tag = new ComponentTag(htmlVoidElement, XmlTag.TagType.OPEN_CLOSE);
      expander.onComponentTag(tag);

      MarkupElement markupElement = expander.nextElement();

      // assert the next element is returned by the parent
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.ComponentTag

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.