Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.WicketTag


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

      // If the tag is not a well-known wicket namespace tag
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

    for (int i = 0; i < markup.size(); i++)
    {
      MarkupElement elem = (MarkupElement)markup.get(i);
      if (elem instanceof WicketTag)
      {
        WicketTag wtag = (WicketTag)elem;
        if (wtag.isExtendTag())
        {
          // Ok, inheritance is on and we must get the
          // inherited markup as well.
          return i;
        }
View Full Code Here

      final ComponentTag tag)
  {
    // It must be <wicket:...>
    if (tag instanceof WicketTag)
    {
      final WicketTag wicketTag = (WicketTag)tag;
     
      // It must be <wicket:extend...>
      if (wicketTag.isExtendTag())
      {
        container.autoAdd(new TransparentWebMarkupContainer(wicketTag.getId()));
          return true;
      }
     
      // It must be <wicket:child...>
      if (wicketTag.isChildTag())
      {
        container.autoAdd(new TransparentWebMarkupContainer(wicketTag.getId()));
          return true;
      }
    }
    // We were not able to handle the componentId
    return false;
View Full Code Here

    // Create a HtmlHeaderContainer for the header tag found
    final MarkupElement element = markupStream.get();
    if (element instanceof WicketTag)
    {
      final WicketTag wTag = (WicketTag)element;
      if ((wTag.isHeadTag() == true) && (wTag.getNamespace() != null))
      {
        // found <wicket:head>
        // create a unique id for the HtmlHeaderContainer to be
        // created
        final String headerId = "_" + Classes.simpleName(markupClass)
            + this.container.getVariation() + "Header" + index;

        // Create the header container and associate the markup with
        // it
        String scope = wTag.getAttributes().getString(
            markupStream.getWicketNamespace() + ":scope");
        final HeaderPartContainer headerContainer = ((IHeaderPartContainerProvider)this.container)
            .newHeaderPartContainer(headerId, scope);
        headerContainer.setMyMarkupStream(markupStream);
        headerContainer.setRenderBodyOnly(true);
View Full Code Here

    MarkupElement elem = associatedMarkupStream.get();
    while (elem != null)
    {
      if (elem instanceof WicketTag)
      {
        WicketTag tag = (WicketTag)elem;
        if (tag.isOpen() && tag.isHeadTag())
        {
          if (this.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
        else if (tag.isOpen()
            && (tag.isPanelTag() || tag.isBorderTag() || tag.isExtendTag()))
        {
          this.noMoreWicketHeadTagsAllowed = true;
        }
      }
      else if (elem instanceof ComponentTag)
      {
        ComponentTag tag = (ComponentTag)elem;
        // wicket:head must be before </head>
        if (tag.isClose() && TagUtils.isHeadTag(tag))
        {
          this.noMoreWicketHeadTagsAllowed = true;
        }
        // wicket:head must be before <body>
        else if (tag.isOpen() && TagUtils.isBodyTag(tag))
        {
          this.noMoreWicketHeadTagsAllowed = true;
        }
      }
      elem = associatedMarkupStream.next();
View Full Code Here

  }
 
  @Override
  public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) {
    if (tag instanceof WicketTag) {
      WicketTag wtag = (WicketTag)tag;
      if (TAG_NAME.equals(wtag.getName())) {
        Boolean escapeKey = wtag.getAttributes().getAsBoolean("escape");
        Long messageKey = wtag.getAttributes().getAsLong("key");
        if (messageKey != null) {
          final String id = "_message_" + container.getPage().getAutoIndex();
          Label label = new Label(id, WebSession.getString(messageKey));
          label.setRenderBodyOnly(container.getApplication()
            .getMarkupSettings()
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

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

    if (!(tag instanceof WicketTag))
    {
      return false;
    }

    final WicketTag wtag = (WicketTag)tag;
    if (!wtag.isBodyTag())
    {
      return false;
    }

    final Response originalResponse;
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.