com.sun.rave.web.ui.renderer
Class AlertRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by com.sun.rave.web.ui.renderer.AbstractRenderer
          extended by com.sun.rave.web.ui.renderer.AlertRenderer

public class AlertRenderer
extends AbstractRenderer

Renderer for an Alert component.


Field Summary
static java.lang.String ALERT_TYPE_DEFAULT
          The default error type - if none is specified.
static java.lang.String ALERT_TYPE_ERROR
          The different types or categories of an alert.
static java.lang.String ALERT_TYPE_INFO
           
static java.lang.String ALERT_TYPE_SUCCESS
           
static java.lang.String ALERT_TYPE_WARN
           
 
Fields inherited from class com.sun.rave.web.ui.renderer.AbstractRenderer
BUNDLE, EVENTS_ATTRIBUTES, I18N_ATTRIBUTES
 
Constructor Summary
AlertRenderer()
          Creates a new instance of AlertRenderer
 
Method Summary
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Render the children of the specified UIComponent to the output stream or writer associated with the response we are creating.
 boolean getRendersChildren()
           
protected  void renderAlertDetailArea(javax.faces.context.FacesContext context, Alert alert, Theme theme, javax.faces.context.ResponseWriter writer)
          Renders the optional detail message of the inline alert.
protected  void renderAlertIcon(javax.faces.context.FacesContext context, Alert alert, java.lang.String type, Theme theme, javax.faces.context.ResponseWriter writer)
          Renders the icon associated with an inline alert message.
protected  void renderAlertLink(javax.faces.context.FacesContext context, Alert alert, Theme theme, javax.faces.context.ResponseWriter writer)
          Renders the optional link at the end of the alert.
protected  void renderAlertSummaryText(Alert alert, javax.faces.context.ResponseWriter writer)
          Renders the summary message of the inline alert.
protected  void renderClosingTags(javax.faces.context.ResponseWriter writer)
          Renders the optional detail message of the inline alert.
protected  void renderEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer)
          Renders the inline alert component.
protected  void renderOpeningTable(javax.faces.context.FacesContext context, Alert alert, Theme theme, javax.faces.context.ResponseWriter writer)
          Renders the attributes for the outer table containing the inline alert.
protected  void renderOuterDiv(javax.faces.context.FacesContext context, Alert alert, javax.faces.context.ResponseWriter writer)
          Renders the outer div which contains the alert.
 
Methods inherited from class com.sun.rave.web.ui.renderer.AbstractRenderer
addBooleanAttributes, addCoreAttributes, addIntegerAttributes, addStringAttributes, decode, encodeBegin, encodeEnd, getApplication, getAsObject, getAsString, getExternalContext, getFacesContext, getSubmittedValue, isDisabled, isPortlet, isReadOnly, renderAttributes, renderMarkup, renderStart, setSubmittedValue
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALERT_TYPE_ERROR

public static final java.lang.String ALERT_TYPE_ERROR

The different types or categories of an alert.

See Also:
Constant Field Values

ALERT_TYPE_WARN

public static final java.lang.String ALERT_TYPE_WARN
See Also:
Constant Field Values

ALERT_TYPE_INFO

public static final java.lang.String ALERT_TYPE_INFO
See Also:
Constant Field Values

ALERT_TYPE_SUCCESS

public static final java.lang.String ALERT_TYPE_SUCCESS
See Also:
Constant Field Values

ALERT_TYPE_DEFAULT

public static final java.lang.String ALERT_TYPE_DEFAULT

The default error type - if none is specified.

See Also:
Constant Field Values
Constructor Detail

AlertRenderer

public AlertRenderer()
Creates a new instance of AlertRenderer

Method Detail

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Description copied from class: AbstractRenderer

Render the children of the specified UIComponent to the output stream or writer associated with the response we are creating.

The default implementation iterates through the children of this component and renders them.

Overrides:
encodeChildren in class AbstractRenderer
Parameters:
context - FacesContext for the current request
component - UIComponent to be decoded
Throws:
java.io.IOException - if an input/output error occurs

renderOuterDiv

protected void renderOuterDiv(javax.faces.context.FacesContext context,
                              Alert alert,
                              javax.faces.context.ResponseWriter writer)
                       throws java.io.IOException
Renders the outer div which contains the alert.

Parameters:
context - The current FacesContext
alert - The Alert object to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderOpeningTable

protected void renderOpeningTable(javax.faces.context.FacesContext context,
                                  Alert alert,
                                  Theme theme,
                                  javax.faces.context.ResponseWriter writer)
                           throws java.io.IOException
Renders the attributes for the outer table containing the inline alert. TODO: Use div's instead of tables for layout as soon as I can find a solution that works for IE.

Parameters:
context - The current FacesContext
alert - The Alert object to use
theme - The Theme to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderAlertIcon

protected void renderAlertIcon(javax.faces.context.FacesContext context,
                               Alert alert,
                               java.lang.String type,
                               Theme theme,
                               javax.faces.context.ResponseWriter writer)
                        throws java.io.IOException
Renders the icon associated with an inline alert message.

Parameters:
context - The current FacesContext
alert - The Alert object to use
theme - The theme to use
type - The type of alert. Default is ALERT_TYPE_ERROR.
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderAlertSummaryText

protected void renderAlertSummaryText(Alert alert,
                                      javax.faces.context.ResponseWriter writer)
                               throws java.io.IOException
Renders the summary message of the inline alert.

Parameters:
alert - The Alert object to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderAlertDetailArea

protected void renderAlertDetailArea(javax.faces.context.FacesContext context,
                                     Alert alert,
                                     Theme theme,
                                     javax.faces.context.ResponseWriter writer)
                              throws java.io.IOException
Renders the optional detail message of the inline alert.

Parameters:
alert - The Alert object to use
theme - The theme to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderAlertLink

protected void renderAlertLink(javax.faces.context.FacesContext context,
                               Alert alert,
                               Theme theme,
                               javax.faces.context.ResponseWriter writer)
                        throws java.io.IOException
Renders the optional link at the end of the alert.

Parameters:
context - The current FacesContext
alert - The Alert object to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderClosingTags

protected void renderClosingTags(javax.faces.context.ResponseWriter writer)
                          throws java.io.IOException
Renders the optional detail message of the inline alert.

Parameters:
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurs

renderEnd

protected void renderEnd(javax.faces.context.FacesContext context,
                         javax.faces.component.UIComponent component,
                         javax.faces.context.ResponseWriter writer)
                  throws java.io.IOException
Renders the inline alert component.

Overrides:
renderEnd in class AbstractRenderer
Parameters:
context - The current FacesContext
component - The Alert object to use
writer - The current ResponseWriter
Throws:
java.io.IOException - if an input/output error occurss