@Override
  public void onComponentTag(Component component, ComponentTag tag) {
    super.onComponentTag(component, tag);

    IValueMap attributes = tag.getAttributes();
    attributes.put("data-header-selector", "#" + header.getMarkupId());
    attributes.put("data-footer-selector", "#" + footer.getMarkupId());
  }
Ejemplo n.º 2
0
  /* (non-Javadoc)
   * @see net.jawr.web.wicket.AbstractJawrReference#createRenderer(net.jawr.web.resource.bundle.handler.ResourceBundlesHandler, boolean, org.apache.wicket.markup.ComponentTag)
   */
  @Override
  protected BundleRenderer createRenderer(
      ResourceBundlesHandler rsHandler, Boolean useRandomParam, ComponentTag tag) {

    final IValueMap attributes = tag.getAttributes();
    boolean defer = attributes.getBoolean(JawrConstant.DEFER_ATTR);
    return new JavascriptHTMLBundleLinkRenderer(rsHandler, useRandomParam, defer);
  }
Ejemplo n.º 3
0
 /**
  * @param form
  * @param tag
  * @return
  */
 private String verifyFormName(Form<?> form, ComponentTag tag) {
   IValueMap attributes = tag.getAttributes();
   String value = attributes.getString("name");
   if (value == null) {
     value = form.getId();
     tag.put("name", value);
   }
   return value;
 }
 public final void replaceAttributeValue(final Component component, final ComponentTag tag) {
   if (this.isEnabled(component)) {
     final IValueMap attributes = tag.getAttributes();
     final Object replacementValue = this.getReplacementOrNull(component);
     if (AttributeModifier.VALUELESS_ATTRIBUTE_ADD == replacementValue) {
       attributes.put((Object) this.attribute, (Object) null);
     } else if (AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE == replacementValue) {
       attributes.remove((Object) this.attribute);
     } else {
       final String value = this.toStringOrNull(attributes.get((Object) this.attribute));
       final String newValue = this.newValue(value, this.toStringOrNull(replacementValue));
       if (newValue != null) {
         attributes.put((Object) this.attribute, (Object) newValue);
       }
     }
   }
 }
Ejemplo n.º 5
0
  @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) {
      attributes.put("step", Objects.stringValue(step));
    } else {
      attributes.remove("step");
    }
  }
Ejemplo n.º 6
0
 /* (non-Javadoc)
  * @see net.jawr.web.wicket.JawrAbstractReference#getReferencePath(org.apache.wicket.util.value.IValueMap)
  */
 protected String getReferencePath(final IValueMap attributes) {
   return (String) attributes.get("src");
 }