Package org.apache.wicket.util.value

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


          if (elm instanceof XmlTag)
          {
            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


  protected void onComponentTag(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

          }
        }

        // 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()).append("\"");
            }
          }
View Full Code Here

  protected void onComponentTag(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

  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

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

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

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

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


    // A piece of javascript to avoid serializing the options during AJAX
    // serialization.
View Full Code Here

   */
  public final void replaceAttributeValue(final Component component, final ComponentTag tag)
  {
    if (isEnabled(component))
    {
      final IValueMap attributes = tag.getAttributes();
      final Object replacementValue = getReplacementOrNull(component);

      if (VALUELESS_ATTRIBUTE_ADD.equals(replacementValue))
      {
        attributes.put(attribute, null);
      }
      else if (VALUELESS_ATTRIBUTE_REMOVE.equals(replacementValue))
      {
        attributes.remove(attribute);
      }
      else
      {
        final String value = toStringOrNull(attributes.get(attribute));
        final String newValue = newValue(value, toStringOrNull(replacementValue));
        if (newValue != null)
        {
          attributes.put(attribute, newValue);
        }
      }
    }
  }
View Full Code Here

   * @return Wicket namespace
   */
  private String determineWicketNamespace(final ComponentTag tag)
  {
    // For all tags attributes
    final IValueMap attributes = tag.getAttributes();
    final Iterator it = attributes.entrySet().iterator();
    while (it.hasNext())
    {
      final Map.Entry entry = (Map.Entry)it.next();

      // Find attributes with namespace "xmlns"
      final String attributeName = (String)entry.getKey();
      if (attributeName.startsWith(XMLNS))
      {
        final String xmlnsUrl = (String)entry.getValue();

        // If Wicket relevant ...
        if ((xmlnsUrl == null) || (xmlnsUrl.trim().length() == 0) ||
            xmlnsUrl.startsWith(WICKET_URI))
        {
          // Set the Wicket namespace for wicket tags (e.g.
          // <wicket:panel>) and attributes (e.g. wicket:id)
          final String namespace = attributeName.substring(XMLNS.length());
          if (Application.get().getMarkupSettings().getStripWicketTags())
          {
            attributes.remove(attributeName);

            // Make sure the parser knows it has been changed
            tag.setModified(true);
          }

View Full Code Here

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

   */
  public final void replaceAttibuteValue(final Component component, final ComponentTag tag)
  {
    if (isEnabled(component))
    {
      final IValueMap attributes = tag.getAttributes();
      final Object replacementValue = getReplacementOrNull(component);

      if (VALUELESS_ATTRIBUTE_ADD.equals(replacementValue))
      {
        attributes.put(attribute, null);
      }
      else if (VALUELESS_ATTRIBUTE_REMOVE.equals(replacementValue))
      {
        attributes.remove(attribute);
      }
      else
      {
        if (attributes.containsKey(attribute))
        {
          final String value = toStringOrNull(attributes.get(attribute));
          if (pattern == null || value.matches(pattern))
          {
            final String newValue = newValue(value, toStringOrNull(replacementValue));
            if (newValue != null)
            {
              attributes.put(attribute, getContextRelativeValue(newValue));
            }
          }
        }
        else if (addAttributeIfNotPresent)
        {
          final String newValue = newValue(null, toStringOrNull(replacementValue));
          if (newValue != null)
          {
            attributes.put(attribute, getContextRelativeValue(newValue));
          }
        }
      }
    }
  }
View Full Code Here

TOP

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

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.