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<>(data1));
    tester.startPage(page);
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

    super(request, filterPrefix);

    Args.notNull(maxSize, "maxSize");
    Args.notNull(upload, "upload");
    this.upload = upload;
    parameters = new ValueMap();
    files = new HashMap<String, List<FileItem>>();

    // Check that request is multipart
    final boolean isMultipart = ServletFileUpload.isMultipartContent(request);
    if (!isMultipart)
View Full Code Here

  /**
   *
   */
  public void testGetStringPropertySubstitution()
  {
    ValueMap vm = new ValueMap();
    vm.put("user", "John Doe");
    IModel<ValueMap> model = new Model<ValueMap>(vm);
    Assert.assertEquals("Property substitution should occur", "Welcome, John Doe",
      localizer.getString("test.substitute", null, model, null));
  }
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

   * @throws IOException
   */
  public void testValueMap() throws IOException
  {
    SerializableChecker checker = new SerializableChecker(new NotSerializableException());
    checker.writeObject(new ValueMap());
  }
View Full Code Here

        item.add(new Label("inst_met_display", instMetString));

        ResourceReference imgRef = new ResourceReference(WorkflowInstancesViewer.class,
            "percentImage.png");
        imgRef.bind(getApplication());
        String resRefString = getRequestCycle().urlFor(imgRef, new ValueMap()).toString();
        item.add(new Label("winst_display", "display('" + resRefString
            + "', 'winst_" + inst.getId() + "_progress', "
            + getPctComplete(inst, lifecycleFilePath) + ", 1);").setEscapeModelStrings(false));

        item.add(new Label("winst_status", inst.getStatus()));
View Full Code Here

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

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

    return parameters;

  }
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

      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)
    {
      // 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 = urlDecodePathComponent(value);
      parameters.add(pairs[i], value);
    }


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

    return parameters;
  }
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.