Package org.apache.wicket.util.value

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


   * Tests if Component#FLAG_INHERITABLE_MODEL reset after model change (WICKET-3413).
   */
  @Test
  public void testResetInheritedModelFlag()
  {
    ValueMap data1 = new ValueMap();
    data1.put("label", "foo");

    ValueMap data2 = new ValueMap();
    data2.put("value", "bar");

    InheritedTestPage page = new InheritedTestPage();

    page.setDefaultModel(new CompoundPropertyModel<ValueMap>(data1));
    tester.startPage(page);
View Full Code Here


   * Tests if Component#FLAG_INHERITABLE_MODEL reset after model change (WICKET-5655).
   */
  @Test
  public void testResetInheritedModelFlag2()
  {
    ValueMap data1 = new ValueMap();
    data1.put("label", "foo");

    ValueMap data2 = new ValueMap();
    data2.put("value", "bar");

    InheritedTestPage page = new InheritedTestPage();

    page.setDefaultModel(new CompoundPropertyModel<ValueMap>(data1));
    tester.startPage(page);
View Full Code Here

   *     the name of the tag
   */
  public MetaDataHeaderItem(String tagName)
  {
    this.tagName = Args.notEmpty(tagName, "tagName");
    this.tagAttributes = new ValueMap();
  }
View Full Code Here

        if (watcher != null)
        {
          addToWatcher(path, resourceStream, watcher);
        }

        ValueMap props = loadFromLoader(loader, resourceStream);
        if (props != null)
        {
          properties = new Properties(path, props);
        }
      }
View Full Code Here

    try
    {
      // Get the InputStream
      in = new BufferedInputStream(resourceStream.getInputStream());
      ValueMap data = loader.loadWicketProperties(in);
      if (data == null)
      {
        java.util.Properties props = loader.loadJavaProperties(in);
        if (props != null)
        {
          // Copy the properties into the ValueMap
          data = new ValueMap();
          Enumeration<?> enumeration = props.propertyNames();
          while (enumeration.hasMoreElements())
          {
            String property = (String)enumeration.nextElement();
            data.put(property, props.getProperty(property));
          }
        }
      }
      return data;
    }
View Full Code Here

  /**
   * Construct.
   */
  public AjaxFormSubmitTestPage()
  {
    super(new CompoundPropertyModel(new ValueMap("txt1=foo,txt2=bar")));
    Form form = new Form("form")
    {
      private static final long serialVersionUID = 1L;

      protected void onSubmit()
View Full Code Here

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

    if (urlFragment.length() == 0)
    {
      return new ValueMap(urlParameters != null ? urlParameters : Collections.EMPTY_MAP);
    }

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

    // If we don't have an even number of pairs
    if (pairs.length % 2 != 0)
    {
      log.warn("URL fragment has unmatched key/value pairs, responding with 404. Fragment: " +
        urlFragment);
      throw new AbortWithWebErrorCodeException(404);
    }

    // Loop through pairs

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


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

    return parameters;
  }
View Full Code Here

   * @return Parameters
   */
  @Override
  protected ValueMap decodeParameters(String fragment, Map passedParameters)
  {
    ValueMap parameters = new ValueMap();

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

    return parameters;

  }
View Full Code Here

  public final ValueMap getMarkupAttributes()
  {
    ComponentTag tag = getMarkupTag();
    if (tag != null)
    {
      ValueMap attrs = new ValueMap(tag.getAttributes());
      attrs.makeImmutable();
      return attrs;
    }
    return ValueMap.EMPTY_MAP;
  }
View Full Code Here

        "&").toString();

      decodedParamReplacement = WicketURLDecoder.QUERY_INSTANCE.decode(decodedParamReplacement);

      // 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

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.