Package org.apache.myfaces.tobago.internal.component

Examples of org.apache.myfaces.tobago.internal.component.AbstractUIImage


  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    AbstractUIImage image = (AbstractUIImage) component;
    final String value = image.getUrl();
    String src = value;
    if (src != null) {
      if (ResourceManagerUtils.isAbsoluteResource(src)) {
        // absolute Path to image : nothing to do
      } else {
        src = null;
        if (isDisabled(image)) {
          src = ResourceManagerUtils.getImageWithPath(facesContext,
              HtmlRendererUtils.createSrc(value, "Disabled"), true);
        }
        if (src == null) {
          src = ResourceManagerUtils.getImageWithPath(facesContext, value);
        }
      }
    }

    String border = (String) image.getAttributes().get(Attributes.BORDER);
    if (border == null) {
      border = "0";
    }
    String alt = (String) image.getAttributes().get(Attributes.ALT);
    if (alt == null) {
      alt = "";
    }

    writer.startElement(HtmlElements.IMG, image);
    final String clientId = image.getClientId(facesContext);
    writer.writeIdAttribute(clientId);
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
    if (src != null) {
      writer.writeAttribute(HtmlAttributes.SRC, src, true);
    }
View Full Code Here


  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    AbstractUIImage image = (AbstractUIImage) component;
    final String value = image.getUrl();
    String src = value;
    if (src != null) {
      if (ResourceManagerUtils.isAbsoluteResource(src)) {
        // absolute Path to image : nothing to do
      } else {
        src = null;
        if (isDisabled(image)) {
          src = ResourceManagerUtils.getImageWithPath(facesContext,
              HtmlRendererUtils.createSrc(value, "Disabled"), true);
        }
        if (src == null) {
          src = ResourceManagerUtils.getImageWithPath(facesContext, value);
        }
      }
    }

    String border = (String) image.getAttributes().get(Attributes.BORDER);
    if (border == null) {
      border = "0";
    }
    String alt = (String) image.getAttributes().get(Attributes.ALT);
    if (alt == null) {
      alt = "";
    }

    writer.startElement(HtmlElements.IMG, image);
    final String clientId = image.getClientId(facesContext);
    writer.writeIdAttribute(clientId);
    if (src != null) {
      writer.writeAttribute(HtmlAttributes.SRC, src, true);
    }
    writer.writeAttribute(HtmlAttributes.ALT, alt, true);
View Full Code Here

  public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    final AbstractUIImage image = (AbstractUIImage) component;
    final String value = image.getUrl();
    String src = value;
    if (src != null) {
      if (ResourceManagerUtils.isAbsoluteResource(src)) {
        // absolute Path to image : nothing to do
      } else {
        src = null;
        if (isDisabled(image)) {
          src = ResourceManagerUtils.getImageWithPath(facesContext,
              HtmlRendererUtils.createSrc(value, "Disabled"), true);
        }
        if (src == null) {
          src = ResourceManagerUtils.getImageWithPath(facesContext, value);
        }
      }
    }

    String border = (String) image.getAttributes().get(Attributes.BORDER);
    if (border == null) {
      border = "0";
    }
    String alt = (String) image.getAttributes().get(Attributes.ALT);
    if (alt == null) {
      alt = "";
    }

    writer.startElement(HtmlElements.IMG, image);
    final String clientId = image.getClientId(facesContext);
    writer.writeIdAttribute(clientId);
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
    if (src != null) {
      writer.writeAttribute(HtmlAttributes.SRC, src, true);
    }
View Full Code Here

  public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    final AbstractUIImage image = (AbstractUIImage) component;
    final String value = image.getUrl();
    String src = value;
    if (src != null) {
      if (ResourceManagerUtils.isAbsoluteResource(src)) {
        // absolute Path to image : nothing to do
      } else {
        src = null;
        if (isDisabled(image)) {
          src = ResourceManagerUtils.getImageWithPath(facesContext,
              HtmlRendererUtils.createSrc(value, "Disabled"), true);
        }
        if (src == null) {
          src = ResourceManagerUtils.getImageWithPath(facesContext, value);
        }
      }
    }

    String border = (String) image.getAttributes().get(Attributes.BORDER);
    if (border == null) {
      border = "0";
    }
    String alt = (String) image.getAttributes().get(Attributes.ALT);
    if (alt == null) {
      alt = "";
    }

    writer.startElement(HtmlElements.IMG, image);
    final String clientId = image.getClientId(facesContext);
    writer.writeIdAttribute(clientId);
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
    if (src != null) {
      writer.writeAttribute(HtmlAttributes.SRC, src, true);
    }
View Full Code Here

  public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    final AbstractUIImage image = (AbstractUIImage) component;
    final String value = image.getUrl();
    String src = value;
    if (src != null) {
      if (ResourceManagerUtils.isAbsoluteResource(src)) {
        // absolute Path to image : nothing to do
      } else {
        src = null;
        if (isDisabled(image)) {
          src = ResourceManagerUtils.getImageWithPath(facesContext,
              HtmlRendererUtils.createSrc(value, "Disabled"), true);
        }
        if (src == null) {
          src = ResourceManagerUtils.getImageWithPath(facesContext, value);
        }
      }
    }

    String border = (String) image.getAttributes().get(Attributes.BORDER);
    if (border == null) {
      border = "0";
    }
    String alt = (String) image.getAttributes().get(Attributes.ALT);
    if (alt == null) {
      alt = "";
    }

    writer.startElement(HtmlElements.IMG, image);
    final String clientId = image.getClientId(facesContext);
    writer.writeIdAttribute(clientId);
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
    if (src != null) {
      writer.writeAttribute(HtmlAttributes.SRC, src, true);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.internal.component.AbstractUIImage

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.