Examples of IValueMap


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

  @Override
  protected void onComponentTag(ComponentTag tag)
  {
    super.onComponentTag(tag);
    IValueMap attrs = tag.getAttributes();
    String onFocus = getPalette().getChoicesOnFocusJS();
    if (onFocus != null)
    {
      attrs.put("onFocus", onFocus);
    }

    tag.getAttributes().put("ondblclick", getPalette().getAddOnClickJS());
  }
View Full Code Here

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

      buffer.append(':');
    }

    buffer.append(name);

    final IValueMap attributes = getAttributes();
    if (attributes.size() > 0)
    {
      final Iterator<String> iterator = attributes.keySet().iterator();
      for (; iterator.hasNext();)
      {
        final String key = iterator.next();
        if ((key != null) &&
          ((attributeToBeIgnored == null) || !key.equalsIgnoreCase(attributeToBeIgnored)))
View Full Code Here

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

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

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

  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");
    }
  }
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 (Iterator iter = attributeMap.keySet().iterator(); iter.hasNext();)
      {
        String attr = (String) iter.next();

        if (attr.equalsIgnoreCase(attribute))
        {
          value = attributeMap.getString(attr);
        }
      }
    }

    return value;
View Full Code Here

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

          {
            XmlTag xmlTag = (XmlTag)elm;

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

              for (Iterator iter = attributeMap.keySet().iterator(); iter.hasNext();)
              {
                String attr = (String) iter.next();
               
                if (attr.equals(attribute) && value.equals(attributeMap.get(attr)))
                {
                  if (xmlTag.isOpen())
                  {
                    openTag = xmlTag;
                  }
View Full Code Here

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

   */
  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, newValue);
            }
          }
        }
        else if (addAttributeIfNotPresent)
        {
          final String newValue = newValue(null, toStringOrNull(replacementValue));
          if (newValue != null)
          {
            attributes.put(attribute, newValue);
          }
        }
      }
    }
  }
View Full Code Here

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

  @Override
  protected void onComponentTag(ComponentTag tag)
  {
    // Must be attached to a style tag
    checkComponentTag(tag, "link");
    IValueMap attributes = tag.getAttributes();
    attributes.put("rel", "stylesheet");
    attributes.put("type", "text/css");
  }
View Full Code Here

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

  @Override
  protected void onComponentTag(ComponentTag tag)
  {
    // Must be attached to a script tag
    checkComponentTag(tag, "script");
    IValueMap attributes = tag.getAttributes();
    attributes.put("type", "text/javascript");
  }
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.