Package org.apache.wicket.markup.parser

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


  private static class TestMarkupElement extends WicketTag
  {
    public TestMarkupElement()
    {
      super(new XmlTag());
    }
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

   */
  @Test
  public void nullModelDoesNotAppendEmptyAttribute()
  {
    AttributeModifier appender = AttributeModifier.append("class", null);
    XmlTag xmlTag = new XmlTag();
    ComponentTag tag = new ComponentTag(xmlTag);
    appender.replaceAttributeValue(null, tag);
    Map<String, Object> attributes = tag.getAttributes();
    assertTrue(attributes.isEmpty());
  }
View Full Code Here

TOP

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

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.