Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.WicketTag


    MarkupElement elem = associatedMarkupStream.get();
    while (elem != null)
    {
      if (elem instanceof WicketTag)
      {
        WicketTag tag = (WicketTag)elem;
        if (tag.isOpen() && tag.isHeadTag())
        {
          if (noMoreWicketHeadTagsAllowed == true)
          {
            throw new MarkupException(
              "<wicket:head> tags are only allowed before <body>, </head>, <wicket:panel> etc. tag");
          }
          return associatedMarkupStream.getCurrentIndex();
        }
        // wicket:head must be before border, panel or extend
        // @TODO why is that? Why can't it be anywhere? (except insight wicket:fragment
        else if (tag.isOpen() &&
          (tag.isPanelTag() || tag.isBorderTag() || tag.isExtendTag()))
        {
          noMoreWicketHeadTagsAllowed = true;
        }
      }
      else if (elem instanceof ComponentTag)
      {
        ComponentTag tag = (ComponentTag)elem;
        // wicket:head must be before </head>
        // @TODO why??
        if (tag.isClose() && TagUtils.isHeadTag(tag))
        {
          noMoreWicketHeadTagsAllowed = true;
        }
        // wicket:head must be before <body>
        // @TODO why??
        else if (tag.isOpen() && TagUtils.isBodyTag(tag))
        {
          noMoreWicketHeadTagsAllowed = true;
        }
      }
      elem = associatedMarkupStream.next();
View Full Code Here


      ComponentTag tag = stream.getTag();
      if (tag.isOpen() || tag.isOpenClose())
      {
        if (tag instanceof WicketTag)
        {
          WicketTag wtag = (WicketTag)tag;
          if (wtag.isPanelTag())
          {
            return stream.getMarkupFragment();
          }
        }
        stream.skipToMatchingCloseTag(tag);
View Full Code Here

      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();
            }
View Full Code Here

  public Component resolve(final MarkupContainer container, final MarkupStream markupStream,
    final ComponentTag tag)
  {
    if (tag instanceof WicketTag)
    {
      WicketTag wtag = (WicketTag)tag;
      if (wtag.isMessageTag())
      {
        String messageKey = wtag.getAttributes().getString("key");
        if ((messageKey == null) || (messageKey.trim().length() == 0))
        {
          throw new MarkupException(
            "Wrong format of <wicket:message key='xxx'>: attribute 'key' is missing");
        }
View Full Code Here

    // Identify tags with Wicket namespace
    if (namespace.equalsIgnoreCase(tag.getNamespace()))
    {
      // It is <wicket:...>
      tag = new WicketTag(tag.getXmlTag());

      if (Strings.isEmpty(wicketIdValue))
      {
        // Make it a Wicket component. Otherwise it would be RawMarkup
        tag.setId(namespace + "_" + tag.getName());
View Full Code Here

    // Identify tags with Wicket namespace
    ComponentTag tag;
    if (namespace.equalsIgnoreCase(xmlTag.getNamespace()))
    {
      // It is <wicket:...>
      tag = new WicketTag(xmlTag);

      // Make it a Wicket component. Otherwise it would be RawMarkup
      tag.setId("_" + tag.getName());
      tag.setAutoComponentTag(true);
      tag.setModified(true);
View Full Code Here

    // For all <wicket:link ..> tags which probably change the
    // current autolink status.
    if (tag instanceof WicketTag)
    {
      final WicketTag wtag = (WicketTag)tag;
      if (wtag.isLinkTag())
      {
        // Beginning of the region
        if (tag.isOpen() || tag.isOpenClose())
        {
          if (tag.isOpen())
View Full Code Here

      final ComponentTag tag)
  {
    // It must be <wicket:...>
    if (tag instanceof WicketTag)
    {
      final WicketTag wicketTag = (WicketTag)tag;
      final String id = wicketTag.getId() + container.getPage().getAutoIndex();

      // It must be <wicket:extend...>
      if (wicketTag.isExtendTag())
      {
        container.autoAdd(new TransparentWebMarkupContainer(id), markupStream);
        return true;
      }

      // It must be <wicket:child...>
      if (wicketTag.isChildTag())
      {
        container.autoAdd(new TransparentWebMarkupContainer(id), markupStream);
        return true;
      }
    }
View Full Code Here

      final ComponentTag tag)
  {
    // If <wicket:...>
    if (tag instanceof WicketTag)
    {
      final WicketTag wTag = (WicketTag)tag;

      // If <wicket:fragment ...>
      if (wTag.isFragementTag())
      {
        // skip the markup associated with the tag
        markupStream.skipComponent();
        return true;
      }
View Full Code Here

    while (stream.hasMore())
    {
      MarkupElement e = stream.next();
      if (e instanceof WicketTag)
      {
        WicketTag wt = (WicketTag)e;
        if (!insideBorderMarkup)
        {
          if (wt.isBorderTag() && wt.isOpen())
          {
            insideBorderMarkup = true;
            continue;
          }
          else
          {
            throw new WicketRuntimeException(
                "Unexpected tag encountered in markup of component border " +
                    getClass().getName() + ". Tag: " + wt.toString() +
                    ", expected tag: <wicket:border>");
          }
        }
        else
        {
          if (wt.isBodyTag())
          {
            break;
          }
          else
          {
            throw new WicketRuntimeException(
                "Unexpected tag encountered in markup of component border " +
                    getClass().getName() + ". Tag: " + wt.toString() +
                    ", expected tag: <wicket:body> or </wicket:body>");
          }
        }
      }
      if (insideBorderMarkup)
View Full Code Here

TOP

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

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.