Package org.apache.wicket.util.value

Examples of org.apache.wicket.util.value.ValueMap


  /**
   * Construct.
   */
  public SimplePage_3()
  {
    ValueMap modelData = new ValueMap();
    modelData.put("testData", "123456");
    setDefaultModel(new Model(modelData));
  }
View Full Code Here


      parameterMap.remove("x");
      String decodedParamReplacement = encodedParamReplacement;
            decodedParamReplacement = WicketURLDecoder.QUERY_INSTANCE.decode(encodedParamReplacement);

      // Add ALL of the params from the decoded 'x' param
      ValueMap params = new ValueMap();
      RequestUtils.decodeParameters(decodedParamReplacement, params);
      parameterMap.putAll(params);

      // Rebuild the URL with the 'x' param removed
      int pos1 = url.indexOf("?x=");
View Full Code Here

    // Render the component without having rendered the page previously
    SimplePage page = new SimplePage();

    Label label = (Label)page.get("myLabel");
    assertNotNull(label);
    ValueMap attr = label.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myLabel", attr.getString("wicket:id"));

    Panel panel = (Panel)page.get("myPanel");
    assertNotNull(panel);
    attr = panel.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myPanel", attr.getString("wicket:id"));

    label = (Label)page.get("myPanel:label");
    assertNotNull(label);
    attr = label.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("label", attr.getString("wicket:id"));

    Border border = (Border)page.get("myBorder");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder", attr.getString("wicket:id"));

    border = (Border)page.get("myBorder2");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder2", attr.getString("wicket:id"));

    // do the same test twice. Igor reported a problem with that, so we have to test it.
    border = (Border)page.get("myBorder2");
    assertNotNull(border);
    attr = border.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myBorder2", attr.getString("wicket:id"));

    WebMarkupContainer container = (WebMarkupContainer)page.get("test");
    assertNotNull(container);
    attr = container.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("test", attr.getString("wicket:id"));

    label = (Label)page.get("test:myLabel2");
    assertNotNull(label);
    attr = label.getMarkupAttributes();
    assertNotNull(attr);
    assertEquals("myLabel2", attr.getString("wicket:id"));
  }
View Full Code Here

   * @return markup attributes
   */
  public final ValueMap getMarkupAttributes()
  {
    MarkupStream markupStream = locateMarkupStream();
    ValueMap attrs = new ValueMap(markupStream.getTag().getAttributes());
    attrs.makeImmutable();
    return attrs;
  }
View Full Code Here

      Time time = resourceReference.lastModifiedTime();
      if (time != null)
      {
        if (parameters == null)
        {
          parameters = new ValueMap();
          parameters.put("wicket:lm", new Long(time.getMilliseconds()));
        }
      }
    }
View Full Code Here

    if (urlFragment.startsWith("/"))
    {
      urlFragment = urlFragment.substring(1);
    }

    ValueMap parameters = new ValueMap();
    parameters.add(URI, urlFragment);

    if (urlParameters != null)
    {
      parameters.putAll(urlParameters);
    }

    return parameters;
  }
View Full Code Here

    {
      Resource.parameters.set(null);
    }
    else
    {
      Resource.parameters.set(new ValueMap(parameters));
    }
  }
View Full Code Here

      urlFragment = urlFragment.substring(0, urlFragment.length() - 1);
    }

    if (urlFragment.length() == 0)
    {
      return new ValueMap();
    }

    // Split into pairs
    final String[] pairs = urlFragment.split("/");

    // If we don't have an even number of pairs
    if (pairs.length % 2 != 0)
    {
      // give up
      throw new IllegalStateException("URL fragment has unmatched key/value " + "pair: " +
          urlFragment);
    }

    // Loop through pairs

    ValueMap parameters = new ValueMap();
    for (int i = 0; i < pairs.length; i += 2)
    {
      String value = pairs[i + 1];
      value = urlDecode(value);
      parameters.add(pairs[i], value);
    }


    if (urlParameters != null)
    {
      parameters.putAll(urlParameters);
    }

    return parameters;
  }
View Full Code Here

   * @return markup attributes
   */
  public final ValueMap getMarkupAttributes()
  {
    MarkupStream markupStream = locateMarkupStream();
    ValueMap attrs = new ValueMap(markupStream.getTag().getAttributes());
    attrs.makeImmutable();
    return attrs;
  }
View Full Code Here

   * @return markup attributes
   */
  public final ValueMap getMarkupAttributes()
  {
    MarkupStream markupStream = locateMarkupStream();
    ValueMap attrs = new ValueMap(markupStream.getTag().getAttributes());
    attrs.makeImmutable();
    return attrs;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.value.ValueMap

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.