com.sun.webui.jsf.component
Class Alert

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by com.sun.webui.jsf.component.WebuiOutput
                  extended by com.sun.webui.jsf.component.Alert
All Implemented Interfaces:
java.util.Comparator, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class Alert
extends WebuiOutput
implements javax.faces.component.NamingContainer, java.util.Comparator

The Alert component is used to render an inline alert message.


Field Summary
static java.lang.String ALERT_IMAGE_FACET
          Facet name for alert image
static java.lang.String ALERT_LINK_FACET
          Facet name for the alert link
 
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Alert()
          Default Constructor.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Return zero if the severity of o1 equals o2, negative 1 if the severity o1 is less than o2, positive 1 if the severity o1 is greater than o2.
 boolean equals(java.lang.Object o)
          Override equals() returns false if object is not an instance of Alarm.
 javax.faces.component.UIComponent getAlertIcon()
          Return a component that implements an alert image.
 javax.faces.component.UIComponent getAlertLink()
          Return a component that implements an alert link.
 java.lang.String getAlt()
          Alternative textual description of the image rendered by this component.
 javax.faces.convert.Converter getConverter()
           
static java.util.List<com.sun.webui.jsf.model.Indicator> getDefaultIndicators()
          Returns a cloned list of the default indicators that can be modified without affecting the default list.
 java.lang.String getDetail()
          Optional detailed message text for the Alert that can include more information about the alert and instructions for what to do about the alert.
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by this component.
 java.util.List<com.sun.webui.jsf.model.Indicator> getIndicators()
          Return a List of Indicators supported by this Alert.
 javax.el.MethodExpression getLinkActionExpression()
          The linkActionExpression attribute is used to specify the action to take when the embedded hyperlink component is activated by the user.
 java.lang.String getLinkTarget()
          The window (target) in which to load the link that is specified with linkText.
 java.lang.String getLinkText()
          The text for an optional link that is appended to the detail message.
 java.lang.String getLinkToolTip()
          Sets the value of the title attribute for the HTML element.
 java.lang.String getLinkURL()
          Absolute, relative, or context relative (starting with "/") URL to the resource to navigate to when the link that is specified with linkText is selected.
 java.lang.String getRendererType()
           
 java.lang.String getStyle()
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getSummary()
          Summary message text for the alert.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 java.lang.String getType()
          The type or category of alert.
 java.lang.Object getValue()
           
 boolean isVisible()
          Indicates 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 setAlt(java.lang.String alt)
          Alternative textual description of the image rendered by this component.
 void setDetail(java.lang.String detail)
          Optional detailed message text for the Alert that can include more information about the alert and instructions for what to do about the alert.
 void setHtmlTemplate(java.lang.String htmlTemplate)
          Set alternative HTML template to be used by this component.
 void setIndicators(java.util.List<com.sun.webui.jsf.model.Indicator> indicators)
          Set the list of indicators supported by this alert.
 void setLinkActionExpression(javax.el.MethodExpression linkActionExpression)
          The linkActionExpression attribute is used to specify the action to take when the embedded hyperlink component is activated by the user.
 void setLinkTarget(java.lang.String linkTarget)
          The window (target) in which to load the link that is specified with linkText.
 void setLinkText(java.lang.String linkText)
          The text for an optional link that is appended to the detail message.
 void setLinkToolTip(java.lang.String linkToolTip)
          Sets the value of the title attribute for the HTML element.
 void setLinkURL(java.lang.String linkURL)
          Absolute, relative, or context relative (starting with "/") URL to the resource to navigate to when the link that is specified with linkText is selected.
 void setStyle(java.lang.String style)
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 void setSummary(java.lang.String summary)
          Summary message text for the alert.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setType(java.lang.String type)
          The type or category of alert.
 void setVisible(boolean visible)
          Indicates whether the component should be viewable by the user in the rendered HTML page.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiOutput
processDecodes, processUpdates, processValidators, setConverter, setId, setRendered
 
Methods inherited from class javax.faces.component.UIOutput
getLocalValue, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALERT_IMAGE_FACET

public static final java.lang.String ALERT_IMAGE_FACET
Facet name for alert image

See Also:
Constant Field Values

ALERT_LINK_FACET

public static final java.lang.String ALERT_LINK_FACET
Facet name for the alert link

See Also:
Constant Field Values
Constructor Detail

Alert

public Alert()
Default Constructor.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class javax.faces.component.UIOutput

getRendererType

public java.lang.String getRendererType()
Overrides:
getRendererType in class javax.faces.component.UIComponentBase

getDefaultIndicators

public static java.util.List<com.sun.webui.jsf.model.Indicator> getDefaultIndicators()
Returns a cloned list of the default indicators that can be modified without affecting the default list.

Typically this method is called by an application that wants to add a an application defined Indicator or replace a default Indicator. An application first call
List list = Alert.getDefaultIndicators();
and them add and/or replace an Indicator.
list.add(appMostSevere); // Add an application indicator
To replace an indicator it must removed first. An indicator is equal to another indicator if their "type" attributes are the equal. If appOkIndicator has type = "ok" this call will remove the default "ok" indicator. list.remove(appOkIndicator);// remove default
After the default indicator is removed add the replacement. list.add(appOkIndicator); // add the replacement
In order for the Alarm component to utilize the modified list the application can have a value expression for the indicators property in which the application returns the modified list, or calls the setIndicators(list) method to assign the modified list.


getHtmlTemplate

public java.lang.String getHtmlTemplate()
Get alternative HTML template to be used by this component.


setHtmlTemplate

public void setHtmlTemplate(java.lang.String htmlTemplate)
Set alternative HTML template to be used by this component.


getAlertIcon

public javax.faces.component.UIComponent getAlertIcon()
Return a component that implements an alert image. If a facet named alertImage is found that component is returned.
If a facet is not found an Icon component instance is returned with the id
alertImage. The Icon instance is intialized with the values from

If a facet is not defined then the returned Icon component is created every time this method is called.

Returns:
- alertImage facet or an Icon instance

getAlertLink

public javax.faces.component.UIComponent getAlertLink()
Return a component that implements an alert link. If a facet named alertLink is found that component is returned.
If a facet is not defined and getLinkText() returns non null, an IconHyperlink component instance is created with the id
alertLink and initialized with the values from: If getLinkText() returns null, null is returned.

If a facet is not defined and if a IconHyperlink component is created, it is reinitialized every time this method is called.

Returns:
- alertLink facet or a IconHyperlink instance or null

getConverter

public javax.faces.convert.Converter getConverter()
Specified by:
getConverter in interface javax.faces.component.ValueHolder
Overrides:
getConverter in class javax.faces.component.UIOutput

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface javax.faces.component.ValueHolder
Overrides:
getValue in class javax.faces.component.UIOutput

getAlt

public java.lang.String getAlt()

Alternative textual description of the image rendered by this component. The alt text can be used by screen readers and in tool tips, and when image display is turned off in the web browser.


setAlt

public void setAlt(java.lang.String alt)

Alternative textual description of the image rendered by this component. The alt text can be used by screen readers and in tool tips, and when image display is turned off in the web browser.

See Also:
getAlt()

getDetail

public java.lang.String getDetail()

Optional detailed message text for the Alert that can include more information about the alert and instructions for what to do about the alert.


setDetail

public void setDetail(java.lang.String detail)

Optional detailed message text for the Alert that can include more information about the alert and instructions for what to do about the alert.

See Also:
getDetail()

getLinkActionExpression

public javax.el.MethodExpression getLinkActionExpression()

The linkActionExpression attribute is used to specify the action to take when the embedded hyperlink component is activated by the user. The value of the linkActionExpression attribute must be one of the following:


setLinkActionExpression

public void setLinkActionExpression(javax.el.MethodExpression linkActionExpression)

The linkActionExpression attribute is used to specify the action to take when the embedded hyperlink component is activated by the user. The value of the linkActionExpression attribute must be one of the following:

See Also:
getLinkActionExpression()

getLinkTarget

public java.lang.String getLinkTarget()

The window (target) in which to load the link that is specified with linkText.


setLinkTarget

public void setLinkTarget(java.lang.String linkTarget)

The window (target) in which to load the link that is specified with linkText.

See Also:
getLinkTarget()

getLinkText

public java.lang.String getLinkText()

The text for an optional link that is appended to the detail message.


setLinkText

public void setLinkText(java.lang.String linkText)

The text for an optional link that is appended to the detail message.

See Also:
getLinkText()

getLinkToolTip

public java.lang.String getLinkToolTip()

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the link that is specified with linkText.


setLinkToolTip

public void setLinkToolTip(java.lang.String linkToolTip)

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the link that is specified with linkText.

See Also:
getLinkToolTip()

getLinkURL

public java.lang.String getLinkURL()

Absolute, relative, or context relative (starting with "/") URL to the resource to navigate to when the link that is specified with linkText is selected.


setLinkURL

public void setLinkURL(java.lang.String linkURL)

Absolute, relative, or context relative (starting with "/") URL to the resource to navigate to when the link that is specified with linkText is selected.

See Also:
getLinkURL()

getStyle

public java.lang.String getStyle()

CSS style or styles to be applied to the outermost HTML element when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style or styles to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyleClass()

getSummary

public java.lang.String getSummary()

Summary message text for the alert. This brief message is prominently displayed next to the icon.


setSummary

public void setSummary(java.lang.String summary)

Summary message text for the alert. This brief message is prominently displayed next to the icon.

See Also:
getSummary()

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getType

public java.lang.String getType()

The type or category of alert. This attribute can be set to "information", "success", "warning", "error" or any custom defined type specified for Indicator. The selection determines which icon is rendered for the alert.


setType

public void setType(java.lang.String type)

The type or category of alert. This attribute can be set to "information", "success", "warning", "error" or any custom defined type specified for Indicator. The selection determines which icon is rendered for the alert.

See Also:
getType()

isVisible

public boolean isVisible()

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


setVisible

public void setVisible(boolean visible)

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

See Also:
isVisible()

getIndicators

public java.util.List<com.sun.webui.jsf.model.Indicator> getIndicators()
Return a List of Indicators supported by this Alert. If indicators has not been set explicitly by the application and if there is no value expression, a list of default alert indicators obtained by calling Alert.getDefaultIndicators() is returned. If the application modifies this list, it must call setIndicators or add a value expression that resolves to the modified list in order to persist the change, otherwise this method will continue to return a list of default alert indicators.


setIndicators

public void setIndicators(java.util.List<com.sun.webui.jsf.model.Indicator> indicators)
Set the list of indicators supported by this alert. If this method is called, any value expression defined for this property are ignored. Call this method to persist changes to a default list of alert indicators.


restoreState

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

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIOutput

saveState

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

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIOutput

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Return zero if the severity of o1 equals o2, negative 1 if the severity o1 is less than o2, positive 1 if the severity o1 is greater than o2.

Specified by:
compare in interface java.util.Comparator

equals

public boolean equals(java.lang.Object o)
Override equals() returns false if object is not an instance of Alarm.

Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.