Package org.apache.wicket.util.value

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


  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


  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

  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

  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<>();

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

  @Test
  public void testGetStringPropertySubstitution()
  {
    Session.get().setLocale(Locale.GERMAN);

    ValueMap vm = new ValueMap();
    vm.put("user", "John Doe");
    vm.put("rating", 4.5);
    IModel<ValueMap> model = new Model<ValueMap>(vm);
    Assert.assertEquals("Property substitution should occur", "John Doe gives 4,5 stars",
      localizer.getString("test.substitute", null, model, null));
  }
View Full Code Here

   * Tests the CPM inheritance by setting a different root model using a rendered scenario.
   */
  @Test
  public void testCompoundPropertyModelRendered()
  {
    ValueMap data1 = new ValueMap();
    data1.put("label", "foo");

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

    InheritedTestPage page = new InheritedTestPage();


    page.setDefaultModel(new CompoundPropertyModel<>(data1));
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

   * Tests the CPM by setting a different root model using a direct scenario.
   */
  @Test
  public void testCompoundPropertyModelDirect()
  {
    ValueMap data1 = new ValueMap();
    data1.put("label", "foo");

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

    WebMarkupContainer parent = new WebMarkupContainer("foo");
    Label label = new Label("label");
    parent.add(label);

    parent.setDefaultModel(new CompoundPropertyModel<>(data1));
    assertEquals("foo", label.getDefaultModelObject());

    parent.setDefaultModel(new CompoundPropertyModel<>(data2));
    assertEquals("bar", label.getDefaultModelObject());

    data2.put("label", "foo");
    assertEquals("foo", label.getDefaultModelObject());
  }
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.