org.apache.myfaces.trinidadinternal.skin.icon
Class BaseImageIcon

java.lang.Object
  extended by org.apache.myfaces.trinidad.skin.Icon
      extended by org.apache.myfaces.trinidadinternal.skin.icon.BaseImageIcon
Direct Known Subclasses:
ContextImageIcon, URIImageIcon

public abstract class BaseImageIcon
extends org.apache.myfaces.trinidad.skin.Icon

A base class for ImageIcon implementations. The base class produces the full image URI by combining a subclass-specific base URI with an image URI that is specified when the BaseImageIcon instance is created. This allows subclasses to implement different strategies for determining the base image URI - eg. ContextImageIcon uses the servlet context path. Subclasses must implement the getBaseURI() method, which provides the base URI to prepend to the image URI.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/icon/BaseImageIcon.java#0 $) $Date: 10-nov-2005.18:59:02 $
Author:
The Oracle ADF Faces Team

Field Summary
 
Fields inherited from class org.apache.myfaces.trinidad.skin.Icon
ALIGN_KEY, EMBEDDED_KEY, HEIGHT_KEY, ID_KEY, INLINE_STYLE_KEY, SHORT_DESC_KEY, STYLE_CLASS_KEY, WIDTH_KEY
 
Constructor Summary
BaseImageIcon(java.lang.String uri, java.lang.String rtlURI, java.lang.Integer width, java.lang.Integer height, java.lang.String styleClass, Style inlineStyle)
          Creates an image Icon which has a different image URI depending on the reading direction.
 
Method Summary
protected abstract  java.lang.String getBaseURI(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns the base URI to prepend to the icon name.
 java.lang.Integer getImageHeight(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Implementation of Icon.getImageHeight().
 java.lang.Object getImageURI(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc)
          Implementation of ImageIcon.getImageURI().
 java.lang.Integer getImageWidth(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Implementation of Icon.getImageWidth().
protected  java.lang.String getRelativeURI(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns the URI of the image relative to the base URI.
 void renderIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.util.Map<java.lang.String,java.lang.Object> attrs)
          Implementation of Icon.renderIcon().
 
Methods inherited from class org.apache.myfaces.trinidad.skin.Icon
isNull, openStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseImageIcon

public BaseImageIcon(java.lang.String uri,
                     java.lang.String rtlURI,
                     java.lang.Integer width,
                     java.lang.Integer height,
                     java.lang.String styleClass,
                     Style inlineStyle)
Creates an image Icon which has a different image URI depending on the reading direction.

Parameters:
uri - The URI to the image to use when the reading direction is left-to-right.
rtlURI - The URI to the image to use when the reading direction is right-to-left.
width - The width of the image
height - The height of the image
styleClass - The style class for the image
inlineStyle - The inline style for the image
Method Detail

getImageURI

public java.lang.Object getImageURI(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.trinidad.context.RenderingContext arc)
Implementation of ImageIcon.getImageURI().

Overrides:
getImageURI in class org.apache.myfaces.trinidad.skin.Icon

getImageWidth

public java.lang.Integer getImageWidth(org.apache.myfaces.trinidad.context.RenderingContext arc)
Implementation of Icon.getImageWidth().

Overrides:
getImageWidth in class org.apache.myfaces.trinidad.skin.Icon

getImageHeight

public java.lang.Integer getImageHeight(org.apache.myfaces.trinidad.context.RenderingContext arc)
Implementation of Icon.getImageHeight().

Overrides:
getImageHeight in class org.apache.myfaces.trinidad.skin.Icon

renderIcon

public void renderIcon(javax.faces.context.FacesContext context,
                       org.apache.myfaces.trinidad.context.RenderingContext arc,
                       java.util.Map<java.lang.String,java.lang.Object> attrs)
                throws java.io.IOException
Implementation of Icon.renderIcon().

Specified by:
renderIcon in class org.apache.myfaces.trinidad.skin.Icon
Throws:
java.io.IOException

getBaseURI

protected abstract java.lang.String getBaseURI(javax.faces.context.FacesContext context,
                                               org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns the base URI to prepend to the icon name. This base URI must be terminated with a trailing URI separator ('/').


getRelativeURI

protected java.lang.String getRelativeURI(javax.faces.context.FacesContext context,
                                          org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns the URI of the image relative to the base URI.



Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.