Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.ComponentTag


      {
        return namespace;
      }
    };

    ComponentTag tag = new ComponentTag(HtmlHeaderResolver.HEADER_ITEMS, XmlTag.TagType.OPEN_CLOSE);
    tag.setNamespace(namespace);
    expander.onComponentTag(tag);

    MarkupElement markupElement = expander.nextElement();

    assertThat(markupElement, CoreMatchers.instanceOf(WicketTag.class));
View Full Code Here


        oldStyles.put("color", "white");
        oldStyles.put("font-size", "9px");
        return oldStyles;
      }
    };
    ComponentTag tag = createTag();

    Map<String, Object> attributes = tag.getAttributes();

    cam.replaceAttributeValue(null, tag);

    String styles = (String) attributes.get(cam.getAttribute());
    assertEquals("color:white;font-size:9px;", styles);
View Full Code Here

        oldStyles.remove("font-size");             // remove
        oldStyles.put("background-color", "red")// add
        return oldStyles;
      }
    };
    ComponentTag tag = createTag();

    Map<String, Object> attributes = tag.getAttributes();
    attributes.put(cam.getAttribute(), "color:white;font-size:9px;");

    cam.replaceAttributeValue(null, tag);

    String classes = (String) attributes.get(cam.getAttribute());
View Full Code Here

        oldStyles.remove("color");
        oldStyles.remove("font-size");
        return oldStyles;
      }
    };
    ComponentTag tag = createTag();

    Map<String, Object> attributes = tag.getAttributes();
    attributes.put(cam.getAttribute(), "color:white ;   font-size:99999px; ");

    cam.replaceAttributeValue(null, tag);

    String classes = (String) attributes.get(cam.getAttribute());
View Full Code Here

  }

  private ComponentTag createTag()
  {
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("StyleAttributeModifier");
    tag.setName("test");
    return tag;
  }
View Full Code Here

        {
          throw new WicketParseException("Missing open tag for Enclosure:", tag);
        }

        // Remove the open tag from the stack
        ComponentTag lastEnclosure = stack.pop();

        // If the child attribute has not been given by the user,
        // then ...
        if (childId != null)
        {
          lastEnclosure.put(CHILD_ATTRIBUTE, childId);
          lastEnclosure.setModified(true);
          childId = null;
        }

        if (stack.size() == 0)
        {
          stack = null;
        }
      }
      else
      {
        throw new WicketParseException("Open-close tag not allowed for Enclosure:", tag);
      }
    }
    // Are we inside a wicket:enclosure tag?
    else if (stack != null)
    {
      ComponentTag lastEnclosure = stack.getLast();

      // If the enclosure tag has NO child attribute, then ...
      if (lastEnclosure.getAttribute(CHILD_ATTRIBUTE) == null)
      {
        String id = tag.getAttribute(getWicketNamespace() + ":id");
        if (id != null)
        {
          // We encountered more than one child component inside
View Full Code Here

        !tag.isAutoComponentTag())
      {
        Iterator<ComponentTag> componentTagIterator = enclosures.descendingIterator();
        while (componentTagIterator.hasNext())
        {
          ComponentTag lastEnclosure = componentTagIterator.next();
          String attr = getAttribute(lastEnclosure, null);
          if (Strings.isEmpty(attr) == true)
          {
            lastEnclosure.getAttributes().put(getInlineEnclosureAttributeName(null),
              tag.getId());
            lastEnclosure.setModified(true);
          }
        }
      }
      else if (tag.isClose() && tag.closes(enclosures.peek()))
      {
        ComponentTag lastEnclosure = enclosures.pop();
        String attr = getAttribute(lastEnclosure, null);
        if (Strings.isEmpty(attr) == true)
        {
          throw new ParseException("Did not find any child for InlineEnclosure. Tag:" +
            lastEnclosure.toString(), tag.getPos());
        }
      }
    }

    return tag;
View Full Code Here

        while (markupStream.hasMore())
        {
          markupStream.next();
          if (markupStream.skipUntil(ComponentTag.class))
          {
            ComponentTag tag = markupStream.getTag();
            if ((tag != null) && (tag.isOpen() || tag.isOpenClose()))
            {
              String tagId = tag.getId();

              if (fullChildId.equals(tagId))
              {
                ComponentTag fullComponentTag = new ComponentTag(tag);
                fullComponentTag.setId(childId.toString());

                controller = ComponentResolvers.resolve(enclosureParent,
                  markupStream, fullComponentTag, new ResolverFilter()
                  {
                    @Override
View Full Code Here

      {
        continue;
      }
      else if (type == HttpTagType.TAG)
      {
        return new ComponentTag(parser.getElement());
      }
      else
      {
        return new HtmlSpecialTag(parser.getElement(), type);
      }
View Full Code Here

   *
   * @return
   */
  public ComponentTag takeTag()
  {
    ComponentTag taken=next;

    if (taken == null)
    {
      return null;
    }

    if (taken.isOpen() && !taken.hasNoCloseTag())
    {
      tags.push(taken);
    }
    else if (tags.size() > 0 && taken.closes(tags.peek()))
    {
      tags.pop();
    }
    next=nextTag();
    return taken;
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.