com.sun.rave.web.ui.component
Class ImageComponentBase

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIGraphic
              extended bycom.sun.rave.web.ui.component.ImageComponentBase
All Implemented Interfaces:
javax.faces.component.StateHolder
Direct Known Subclasses:
ImageComponent

public abstract class ImageComponentBase
extends javax.faces.component.UIGraphic

Use the ui:image tag to display an inline image in the rendered HTML page. The url attribute is used to specify the URL to the image file that is to be displayed.   If you use an image that is a PNG type and ends with ".png " this tag will output the correct format for an <img> tag to display a PNG correctly in Internet Explorer.  In order to use this feature you must set the height and width properties of this tag..

The ui:image tag can be used to display a theme-specific image in the rendered HTML page. The icon attribute used in the ui:image tag is a key value that is mapped to a URL in theme properties file. The key is used to look up the appropriate image source and related attributes from the current theme. By specifying a key, you avoid the need to specify predefined constants such as height and width. The image can also be seamlessly changed when a different theme is selected.

Note: currently the list of icons that you can use is not publicly supported, but the icon names are specified in the /com/sun/rave/web/ui/suntheme/SunTheme.properties file. The names are listed as resource keys of the format image.ICON_NAME. Use only the part of the key that follows image. For example, if the key is image.ALARM_CRITICAL_SMALL, you should specify ALARM_CRITICAL_SMALL as the value of the icon attribute of the ui:icon tag. A list of supported icon values will be published in the near future.

HTML Elements and Layout

The rendered HTML page displays an XHTML compliant <img> element with any applicable element attributes. The attributes can be specified through the <ui:image> tag attributes.

Client Side Javascript Functions

None.

Examples

Example 1: Create an image

<ui:image id="image1" url="../images/dot.gif" />

This will generate the following markup:
  
<img src="../images/dot.gif" alt="" />

Example 2: Create a theme specific image

<ui:image id="image2" icon="ALARM_CRITICAL_SMALL" />

Auto-generated component class. Do NOT modify; all changes will be lost!


Field Summary
 
Fields inherited from class javax.faces.component.UIGraphic
COMPONENT_FAMILY, COMPONENT_TYPE
 
Constructor Summary
ImageComponentBase()
          Construct a new ImageComponentBase.
 
Method Summary
 java.lang.String getAlign()
          Specifies the position of the image with respect to its context.
 java.lang.String getAlt()
          Alternative text description used by screen reader tools
 int getBorder()
          Specifies the width of the img border in pixels.
 java.lang.String getFamily()
          Return the family for this component.
 int getHeight()
          When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values
 int getHspace()
          Specifies the amount of white space in pixels to be inserted to the left and right of the image.
 java.lang.String getIcon()
          The identifier of the desired theme image.
 java.lang.String getLongDesc()
          A verbose description of this image
 java.lang.String getOnClick()
          Scripting code executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code executed when a mouse double click occurs over this component.
 java.lang.String getOnMouseDown()
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 java.lang.String getStyle()
          CSS style(s) to be applied when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class(es) to be applied when this component is rendered.
 java.lang.String getToolTip()
          Display the text as a tooltip for this component
 java.lang.String getUrl()
          Absolute or relative URL to the image to be rendered.
 javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
          Return the ValueBinding stored for the specified name (if any), respecting any property aliases.
 int getVspace()
          Specifies the amount of white space in pixels to be inserted above and below the image.
 int getWidth()
          Image width override.
 boolean isVisible()
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setAlign(java.lang.String align)
          Specifies the position of the image with respect to its context.
 void setAlt(java.lang.String alt)
          Alternative text description used by screen reader tools
 void setBorder(int border)
          Specifies the width of the img border in pixels.
 void setHeight(int height)
          When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values
 void setHspace(int hspace)
          Specifies the amount of white space in pixels to be inserted to the left and right of the image.
 void setIcon(java.lang.String icon)
          The identifier of the desired theme image.
 void setLongDesc(java.lang.String longDesc)
          A verbose description of this image
 void setOnClick(java.lang.String onClick)
          Scripting code executed when a mouse click occurs over this component.
 void setOnDblClick(java.lang.String onDblClick)
          Scripting code executed when a mouse double click occurs over this component.
 void setOnMouseDown(java.lang.String onMouseDown)
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 void setOnMouseMove(java.lang.String onMouseMove)
          Scripting code executed when the user moves the mouse pointer while over the component.
 void setOnMouseOut(java.lang.String onMouseOut)
          Scripting code executed when a mouse out movement occurs over this component.
 void setOnMouseOver(java.lang.String onMouseOver)
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 void setOnMouseUp(java.lang.String onMouseUp)
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 void setStyle(java.lang.String style)
          CSS style(s) to be applied when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied when this component is rendered.
 void setToolTip(java.lang.String toolTip)
          Display the text as a tooltip for this component
 void setUrl(java.lang.String url)
          Absolute or relative URL to the image to be rendered.
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
          Set the ValueBinding stored for the specified name (if any), respecting any property aliases.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void setVspace(int vspace)
          Specifies the amount of white space in pixels to be inserted above and below the image.
 void setWidth(int width)
          Image width override.
 
Methods inherited from class javax.faces.component.UIGraphic
getValue, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageComponentBase

public ImageComponentBase()

Construct a new ImageComponentBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.


getValueBinding

public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)

Return the ValueBinding stored for the specified name (if any), respecting any property aliases.

Parameters:
name - Name of value binding to retrieve

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)

Set the ValueBinding stored for the specified name (if any), respecting any property aliases.

Parameters:
name - Name of value binding to set
binding - ValueBinding to set, or null to remove

getAlign

public java.lang.String getAlign()

Specifies the position of the image with respect to its context. Valid values are: bottom (the default); middle; top; left; right.


setAlign

public void setAlign(java.lang.String align)

Specifies the position of the image with respect to its context. Valid values are: bottom (the default); middle; top; left; right.

See Also:
getAlign()

getAlt

public java.lang.String getAlt()

Alternative text description used by screen reader tools


setAlt

public void setAlt(java.lang.String alt)

Alternative text description used by screen reader tools

See Also:
getAlt()

getBorder

public int getBorder()

Specifies the width of the img border in pixels. The default value for this attribute depends on the web browser


setBorder

public void setBorder(int border)

Specifies the width of the img border in pixels. The default value for this attribute depends on the web browser

See Also:
getBorder()

getHeight

public int getHeight()

When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values


setHeight

public void setHeight(int height)

When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values

See Also:
getHeight()

getHspace

public int getHspace()

Specifies the amount of white space in pixels to be inserted to the left and right of the image. The default value is not specified but is generally a small, non-zero size.


setHspace

public void setHspace(int hspace)

Specifies the amount of white space in pixels to be inserted to the left and right of the image. The default value is not specified but is generally a small, non-zero size.

See Also:
getHspace()

getIcon

public java.lang.String getIcon()

The identifier of the desired theme image.


setIcon

public void setIcon(java.lang.String icon)

The identifier of the desired theme image.

See Also:
getIcon()

getLongDesc

public java.lang.String getLongDesc()

A verbose description of this image


setLongDesc

public void setLongDesc(java.lang.String longDesc)

A verbose description of this image

See Also:
getLongDesc()

getOnClick

public java.lang.String getOnClick()

Scripting code executed when a mouse click occurs over this component.


setOnClick

public void setOnClick(java.lang.String onClick)

Scripting code executed when a mouse click occurs over this component.

See Also:
getOnClick()

getOnDblClick

public java.lang.String getOnDblClick()

Scripting code executed when a mouse double click occurs over this component.


setOnDblClick

public void setOnDblClick(java.lang.String onDblClick)

Scripting code executed when a mouse double click occurs over this component.

See Also:
getOnDblClick()

getOnMouseDown

public java.lang.String getOnMouseDown()

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.


setOnMouseDown

public void setOnMouseDown(java.lang.String onMouseDown)

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseDown()

getOnMouseMove

public java.lang.String getOnMouseMove()

Scripting code executed when the user moves the mouse pointer while over the component.


setOnMouseMove

public void setOnMouseMove(java.lang.String onMouseMove)

Scripting code executed when the user moves the mouse pointer while over the component.

See Also:
getOnMouseMove()

getOnMouseOut

public java.lang.String getOnMouseOut()

Scripting code executed when a mouse out movement occurs over this component.


setOnMouseOut

public void setOnMouseOut(java.lang.String onMouseOut)

Scripting code executed when a mouse out movement occurs over this component.

See Also:
getOnMouseOut()

getOnMouseOver

public java.lang.String getOnMouseOver()

Scripting code executed when the user moves the mouse pointer into the boundary of this component.


setOnMouseOver

public void setOnMouseOver(java.lang.String onMouseOver)

Scripting code executed when the user moves the mouse pointer into the boundary of this component.

See Also:
getOnMouseOver()

getOnMouseUp

public java.lang.String getOnMouseUp()

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.


setOnMouseUp

public void setOnMouseUp(java.lang.String onMouseUp)

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseUp()

getStyle

public java.lang.String getStyle()

CSS style(s) to be applied when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style(s) to be applied when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class(es) to be applied when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class(es) to be applied when this component is rendered.

See Also:
getStyleClass()

getToolTip

public java.lang.String getToolTip()

Display the text as a tooltip for this component


setToolTip

public void setToolTip(java.lang.String toolTip)

Display the text as a tooltip for this component

See Also:
getToolTip()

getUrl

public java.lang.String getUrl()

Absolute or relative URL to the image to be rendered.


setUrl

public void setUrl(java.lang.String url)

Absolute or relative URL to the image to be rendered.

See Also:
getUrl()

isVisible

public boolean isVisible()

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

getVspace

public int getVspace()

Specifies the amount of white space in pixels to be inserted above and below the image. The default value is not specified but is generally a small, non-zero size.


setVspace

public void setVspace(int vspace)

Specifies the amount of white space in pixels to be inserted above and below the image. The default value is not specified but is generally a small, non-zero size.

See Also:
getVspace()

getWidth

public int getWidth()

Image width override. When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values, specified in pixels. Some browsers might not support this behavior.


setWidth

public void setWidth(int width)

Image width override. When specified, the width and height attributes tell web browsers to override the natural image or object size in favor of these values, specified in pixels. Some browsers might not support this behavior.

See Also:
getWidth()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.


saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.