Examples of IValueMap


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

   */
  public String getAttribute(String attribute)
  {
    String value = null;

    IValueMap attributeMap = openTag.getAttributes();

    if (attributeMap != null)
    {
      for (String attr : attributeMap.keySet())
      {
        if (attr.equalsIgnoreCase(attribute))
        {
          value = attributeMap.getString(attr);
        }
      }
    }

    return value;
View Full Code Here

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

        {
          XmlTag xmlTag = elm;

          if (openTag == null)
          {
            IValueMap attributeMap = xmlTag.getAttributes();

            for (Map.Entry<String, Object> entry : attributeMap.entrySet())
            {
              String attr = entry.getKey();
              if (attr.equals(attribute) && value.equals(entry.getValue()))
              {
                if (xmlTag.isOpen())
View Full Code Here

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

        while ((elm = parser.nextTag()) != null)
        {
          XmlTag xmlTag = elm;
          if (openTag == null)
          {
            IValueMap attributeMap = xmlTag.getAttributes();
            for (Map.Entry<String, Object> entry : attributeMap.entrySet())
            {
              if (entry.getKey().equals(attribute) && value.equals(entry.getValue()))
              {
                if (xmlTag.isOpen())
                {
View Full Code Here

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

  @Override
  protected void onComponentTag(final ComponentTag tag)
  {
    super.onComponentTag(tag);

    IValueMap attributes = tag.getAttributes();

    if (minimum != null)
    {
      attributes.put("min", Objects.stringValue(minimum));
    }
    else
    {
      attributes.remove("min");
    }

    if (maximum != null)
    {
      attributes.put("max", Objects.stringValue(maximum));
    }
    else
    {
      attributes.remove("max");
    }

    if (step != null)
    {
      if (step.doubleValue() == ANY)
      {
        attributes.put("step", "any");
      }
      else
      {
        attributes.put("step", Objects.stringValue(step));
      }
    }
    else
    {
      attributes.remove("step");
    }
  }
View Full Code Here

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

      {
        escaped = Strings.escapeMarkup(display);
      }

      // Allows user to add attributes to the <label..> tag
      IValueMap labelAttrs = getAdditionalAttributesForLabel(index, choice);
      StringBuilder extraLabelAttributes = new StringBuilder();
      if (labelAttrs != null)
      {
        for (Map.Entry<String, Object> attr : labelAttrs.entrySet())
        {
          extraLabelAttributes.append(' ')
              .append(attr.getKey())
              .append("=\"")
              .append(attr.getValue())
              .append('"');
        }
      }

      switch (labelPosition)
      {
        case BEFORE:

          buffer.append("<label for=\"")
              .append(idAttr)
              .append('"')
              .append(extraLabelAttributes)
              .append('>')
              .append(escaped)
              .append("</label>");
          break;
        case WRAP_BEFORE:
          buffer.append("<label")
              .append(extraLabelAttributes)
              .append('>')
              .append(escaped)
              .append(' ');
          break;
        case WRAP_AFTER:
          buffer.append("<label")
              .append(extraLabelAttributes)
              .append('>');
          break;
      }

      // Add radio tag
      buffer.append("<input name=\"")
        .append(getInputName())
        .append('"')
        .append(" type=\"radio\"")
        .append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""))
        .append((enabled ? "" : " disabled=\"disabled\""))
        .append(" value=\"")
        .append(id)
        .append("\" id=\"")
        .append(idAttr)
        .append('"');

      // Should a roundtrip be made (have onSelectionChanged called)
      // when the option is clicked?
      if (wantOnSelectionChangedNotifications())
      {
        CharSequence url = urlFor(IOnChangeListener.INTERFACE, new PageParameters());

        Form<?> form = findParent(Form.class);
        if (form != null)
        {
          buffer.append(" onclick=\"")
            .append(form.getJsForInterfaceUrl(url))
            .append(";\"");
        }
        else
        {
          // NOTE: do not encode the url as that would give
          // invalid JavaScript
          buffer.append(" onclick=\"window.location.href='")
            .append(url)
            .append((url.toString().indexOf('?') > -1 ? '&' : '?') + getInputName())
            .append('=')
            .append(id)
            .append("';\"");
        }
      }

      // Allows user to add attributes to the <input..> tag
      {
        IValueMap attrs = getAdditionalAttributes(index, choice);
        if (attrs != null)
        {
          for (Map.Entry<String, Object> attr : attrs.entrySet())
          {
            buffer.append(' ')
              .append(attr.getKey())
              .append("=\"")
              .append(attr.getValue())
View Full Code Here

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

  @Override
  protected void onComponentTag(final ComponentTag tag)
  {
    super.onComponentTag(tag);

    IValueMap attributes = tag.getAttributes();

    if (minimum != null)
    {
      attributes.put("min", minimum);
    }
    else
    {
      attributes.remove("min");
    }

    if (maximum != null)
    {
      attributes.put("max", maximum);
    }
    else
    {
      attributes.remove("max");
    }
  }
View Full Code Here

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

          }
        }

        // Allows user to add attributes to the <input..> tag
        {
          IValueMap attrs = getAdditionalAttributes(index, choice);
          if (attrs != null)
          {
            for (Map.Entry<String, Object> attr : attrs.entrySet())
            {
              buffer.append(" ")
                .append(attr.getKey())
                .append("=\"")
                .append(attr.getValue())
View Full Code Here

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

  protected void onComponentTag(final ComponentTag tag)
  {
    checkComponentTag(tag, "select");

    super.onComponentTag(tag);
    IValueMap attrs = tag.getAttributes();

    attrs.put("multiple", "multiple");
    attrs.put("size", getPalette().getRows());

    if (!palette.isPaletteEnabled())
    {
      attrs.put("disabled", "disabled");
    }

    avoidAjaxSerialization();
  }
View Full Code Here

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

   */
  protected boolean analyzeAutolinkCondition(final ComponentTag tag)
  {
    if (tag.getId() == null)
    {
      IValueMap attributes = tag.getAttributes();
      String ref = attributes.getString("href");
      if (checkRef(ref))
      {
        return true;
      }
      ref = attributes.getString("src");
      if (checkRef(ref))
      {
        return true;
      }
    }
View Full Code Here

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

   */
  public String getAttribute(String attribute)
  {
    String value = null;

    IValueMap attributeMap = openTag.getAttributes();

    if (attributeMap != null)
    {
      for (String attr : attributeMap.keySet())
      {
        if (attr.equalsIgnoreCase(attribute))
        {
          value = attributeMap.getString(attr);
        }
      }
    }

    return value;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.