コード例 #1
0
ファイル: ImageButton.java プロジェクト: JUGMadagascar/wicket
  /**
   * Processes the component tag.
   *
   * @param tag Tag to modify
   * @see org.apache.wicket.Component#onComponentTag(ComponentTag)
   */
  @Override
  protected final void onComponentTag(final ComponentTag tag) {
    checkComponentTag(tag, "input");
    checkComponentTagAttribute(tag, "type", "image");

    final IResource resource = getImageResource();
    if (resource != null) {
      localizedImageResource.setResource(resource);
    }
    final ResourceReference resourceReference = getImageResourceReference();
    if (resourceReference != null) {
      localizedImageResource.setResourceReference(resourceReference);
    }
    localizedImageResource.setSrcAttribute(tag);
    super.onComponentTag(tag);
  }
コード例 #2
0
ファイル: Image.java プロジェクト: tfreier/wicket
  /** @see org.apache.wicket.Component#onComponentTag(ComponentTag) */
  @Override
  protected void onComponentTag(final ComponentTag tag) {
    checkComponentTag(tag, "img");
    super.onComponentTag(tag);
    final IResource resource = getImageResource();
    if (resource != null) {
      localizedImageResource.setResource(resource);
    }
    final ResourceReference resourceReference = getImageResourceReference();
    if (resourceReference != null) {
      localizedImageResource.setResourceReference(resourceReference);
    }
    localizedImageResource.setSrcAttribute(tag);

    if (shouldAddAntiCacheParameter()) {
      addAntiCacheParameter(tag);
    }
  }