Package org.apache.wicket.markup.parser

Examples of org.apache.wicket.markup.parser.XmlTag$TextSegment


  public String getWicketAjaxBaseUrlEncodedInLastResponse() throws IOException,
    ResourceStreamNotFoundException, ParseException
  {
    XmlPullParser parser = new XmlPullParser();
    parser.parse(getLastResponseAsString());
    XmlTag tag;
    while ((tag = parser.nextTag()) != null)
    {
      if (tag.isOpen() && tag.getName().equals("script") &&
        "wicket-ajax-base-url".equals(tag.getAttribute("id")))
      {
        parser.next();
        return parser.getString().toString().split("\\\"")[1];
      }
    }
View Full Code Here


      XmlPullParser parser = new XmlPullParser();
      parser.parse(is);

      while (true)
      {
        XmlTag elem;
        do
        {
          elem = (XmlTag)parser.nextTag();
        }
        while (elem != null && (!(elem.getName().equals(mapping) && elem.isOpen())));

        if (elem == null)
        {
          break;
        }

        String encounteredFilterName = null, urlPattern = null;

        do
        {
          elem = (XmlTag)parser.nextTag();
          if (elem.isOpen())
          {
            parser.setPositionMarker();
          }
          else if (elem.isClose() && elem.getName().equals(name))
          {
            encounteredFilterName = parser.getInputFromPositionMarker(elem.getPos())
              .toString()
              .trim();
          }
          else if (elem.isClose() && elem.getName().equals("url-pattern"))
          {
            urlPattern = parser.getInputFromPositionMarker(elem.getPos())
              .toString()
              .trim();
          }
        }
        while (urlPattern == null || encounteredFilterName == null);
View Full Code Here

  public String getWicketAjaxBaseUrlEncodedInLastResponse() throws IOException,
    ResourceStreamNotFoundException, ParseException
  {
    XmlPullParser parser = new XmlPullParser();
    parser.parse(getLastResponseAsString());
    XmlTag tag;
    while ((tag = parser.nextTag()) != null)
    {
      if (tag.isOpen() && tag.getName().equals("script") &&
        "wicket-ajax-base-url".equals(tag.getAttribute("id")))
      {
        parser.next();
        return parser.getString().toString().split("\\\"")[1];
      }
    }
View Full Code Here

   */
  @Test
  public void nullModelDoesNotThrowNullPointerExceptions()
  {
    AttributeModifier modifier = new AttributeModifier("test", null);
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("foo");
    tag.setName("test");
    modifier.replaceAttributeValue(null, tag);
    Map<String, Object> attributes = tag.getAttributes();
View Full Code Here

      protected String newValue(String currentValue, String replacementValue)
      {
        return "the replacement";
      }
    };
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    modifier.replaceAttributeValue(null, tag);
    Map<String, Object> attributes = tag.getAttributes();
View Full Code Here

   */
  @Test
  public void testModelReplacement()
  {
    AttributeModifier modifier = new AttributeModifier("test", Model.of("Ellioth Smith Rocks"));
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    modifier.replaceAttributeValue(null, tag);
    Map<String, Object> attributes = tag.getAttributes();
View Full Code Here

   */
  @Test
  public void testModelReplacementOverwritingExistingAttributeValue()
  {
    AttributeModifier modifier = new AttributeModifier("test", Model.of("Ellioth Smith Rocks"));
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    Map<String, Object> attributes = tag.getAttributes();
    attributes.put("test", "My mother rocks");
View Full Code Here

      {
        return false;
      }
    };

    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    Map<String, Object> attributes = tag.getAttributes();
    attributes.put("test", "My mother rocks");
View Full Code Here

      protected String newValue(String currentValue, String replacementValue)
      {
        return replacementValue + " together";
      }
    };
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    modifier.replaceAttributeValue(null, tag);
    Map<String, Object> attributes = tag.getAttributes();
View Full Code Here

      protected String newValue(String currentValue, String replacementValue)
      {
        return currentValue + " two";
      }
    };
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    tag.setId("test");
    tag.setName("id");
    Map<String, Object> attributes = tag.getAttributes();
    attributes.put("test", "one");
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.parser.XmlTag$TextSegment

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.