com.sun.webui.jsf.component
Class Alarm

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIGraphic
              extended by com.sun.webui.jsf.component.ImageComponent
                  extended by com.sun.webui.jsf.component.Alarm
All Implemented Interfaces:
java.util.Comparator, javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class Alarm
extends ImageComponent
implements javax.faces.component.NamingContainer, java.util.Comparator

The Alarm component is used to display a theme-specific image to indicate the condition of an object.


Field Summary
static java.lang.String DEFAULT_SEVERITY
          Default severity, SEVERITY_OK.
static java.lang.String SEVERITY_CRITICAL
          Critical alarm severity.
static java.lang.String SEVERITY_DOWN
          Down alarm severity.
static java.lang.String SEVERITY_MAJOR
          Major alarm severity.
static java.lang.String SEVERITY_MINOR
          Minor alarm severity.
static java.lang.String SEVERITY_OK
          Ok alarm severity.
 
Fields inherited from class javax.faces.component.UIGraphic
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Alarm()
          Default constructor.
Alarm(java.lang.String severity)
          Deprecated.  
 
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.
 void encodeBegin(javax.faces.context.FacesContext context)
           
 boolean equals(java.lang.Object o)
          Override equals() returns false if object is not an instance of Alarm.
 java.lang.String getAlt()
          Alternative textual description of the image rendered by this component.
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 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 Alarm.
 java.lang.String getOnClick()
          Scripting code that is executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code that is executed when a mouse double click occurs over this component.
 java.lang.String getOnKeyDown()
          Scripting code that is executed when the user presses down on a key while the component has focus.
 java.lang.String getOnKeyPress()
          Scripting code that is executed when the user presses and releases a key while the component has focus.
 java.lang.String getOnKeyUp()
          Scripting code that is executed when the user releases a key while the component has focus.
 java.lang.String getOnMouseDown()
          Scripting code that is executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code that is executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code that is executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code that is executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code that is executed when the user releases a mouse button while the mouse pointer is on the component.
 java.lang.String getRendererType()
           
 java.lang.String getSeverity()
          Specifies the severity of the alarm.
 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 getText()
          The text description of the alarm.
 java.lang.String getTextPosition()
          Specifies where the text will be placed relative to the image.
 java.lang.String getToolTip()
          Sets the value of the title attribute for the HTML element.
 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 setHtmlTemplate(java.lang.String htmlTemplate)
          Set alternative HTML template to be used by this component.
 void setId(java.lang.String id)
          The component identifier for this component.
 void setIndicators(java.util.List<com.sun.webui.jsf.model.Indicator> indicators)
          Set the list of indicators supported by this alarm.
 void setOnClick(java.lang.String onClick)
          Scripting code that is executed when a mouse click occurs over this component.
 void setOnDblClick(java.lang.String onDblClick)
          Scripting code that is executed when a mouse double click occurs over this component.
 void setOnKeyDown(java.lang.String onKeyDown)
          Scripting code that is executed when the user presses down on a key while the component has focus.
 void setOnKeyPress(java.lang.String onKeyPress)
          Scripting code that is executed when the user presses and releases a key while the component has focus.
 void setOnKeyUp(java.lang.String onKeyUp)
          Scripting code that is executed when the user releases a key while the component has focus.
 void setOnMouseDown(java.lang.String onMouseDown)
          Scripting code that is executed when the user presses a mouse button while the mouse pointer is on the component.
 void setOnMouseMove(java.lang.String onMouseMove)
          Scripting code that is executed when the user moves the mouse pointer while over the component.
 void setOnMouseOut(java.lang.String onMouseOut)
          Scripting code that is executed when a mouse out movement occurs over this component.
 void setOnMouseOver(java.lang.String onMouseOver)
          Scripting code that is executed when the user moves the mouse pointer into the boundary of this component.
 void setOnMouseUp(java.lang.String onMouseUp)
          Scripting code that is executed when the user releases a mouse button while the mouse pointer is on the component.
 void setRendered(boolean rendered)
          Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page.
 void setSeverity(java.lang.String severity)
          Specifies the severity of the alarm.
 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 setText(java.lang.String text)
          The text description of the alarm.
 void setTextPosition(java.lang.String textPosition)
          Specifies where the text will be placed relative to the image.
 void setToolTip(java.lang.String toolTip)
          Sets the value of the title attribute for the HTML element.
 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.ImageComponent
getAlign, getBorder, getHeight, getHspace, getIcon, getLongDesc, getUrl, getValueExpression, getVspace, getWidth, setAlign, setBorder, setHeight, setHspace, setIcon, setLongDesc, setUrl, setValueExpression, setVspace, setWidth
 
Methods inherited from class javax.faces.component.UIGraphic
getValueBinding, setValue, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient
 
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

SEVERITY_DOWN

public static final java.lang.String SEVERITY_DOWN
Down alarm severity.

See Also:
Constant Field Values

SEVERITY_CRITICAL

public static final java.lang.String SEVERITY_CRITICAL
Critical alarm severity.

See Also:
Constant Field Values

SEVERITY_MAJOR

public static final java.lang.String SEVERITY_MAJOR
Major alarm severity.

See Also:
Constant Field Values

SEVERITY_MINOR

public static final java.lang.String SEVERITY_MINOR
Minor alarm severity.

See Also:
Constant Field Values

SEVERITY_OK

public static final java.lang.String SEVERITY_OK
Ok alarm severity.

See Also:
Constant Field Values

DEFAULT_SEVERITY

public static final java.lang.String DEFAULT_SEVERITY
Default severity, SEVERITY_OK.

See Also:
Constant Field Values
Constructor Detail

Alarm

public Alarm()
Default constructor.


Alarm

public Alarm(java.lang.String severity)
Deprecated. 

Create an instance with the given severity.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class ImageComponent

getRendererType

public java.lang.String getRendererType()
Overrides:
getRendererType in class ImageComponent

getHtmlTemplate

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

Overrides:
getHtmlTemplate in class ImageComponent

setHtmlTemplate

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

Overrides:
setHtmlTemplate in class ImageComponent

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 = Alarm.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.


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

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

setId

public void setId(java.lang.String id)
The component identifier for this component. This value must be unique within the closest parent component that is a naming container.

Overrides:
setId in class ImageComponent

getIndicators

public java.util.List<com.sun.webui.jsf.model.Indicator> getIndicators()
Return a List of Indicators supported by this Alarm. If indicators has not been set explicitly by the application and if there is no value expression, a list of default alarm indicators obtained by calling DefaultAlarmIndicators.getIndicators() 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 alarm indicators.


setIndicators

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


setRendered

public void setRendered(boolean rendered)
Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission.

Overrides:
setRendered in class ImageComponent

getValue

public java.lang.Object getValue()
Overrides:
getValue in class ImageComponent

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.

Overrides:
getAlt in class ImageComponent

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.

Overrides:
setAlt in class ImageComponent
See Also:
getAlt()

getOnClick

public java.lang.String getOnClick()

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

Overrides:
getOnClick in class ImageComponent

setOnClick

public void setOnClick(java.lang.String onClick)

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

Overrides:
setOnClick in class ImageComponent
See Also:
getOnClick()

getOnDblClick

public java.lang.String getOnDblClick()

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

Overrides:
getOnDblClick in class ImageComponent

setOnDblClick

public void setOnDblClick(java.lang.String onDblClick)

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

Overrides:
setOnDblClick in class ImageComponent
See Also:
getOnDblClick()

getOnKeyDown

public java.lang.String getOnKeyDown()

Scripting code that is executed when the user presses down on a key while the component has focus.


setOnKeyDown

public void setOnKeyDown(java.lang.String onKeyDown)

Scripting code that is executed when the user presses down on a key while the component has focus.

See Also:
getOnKeyDown()

getOnKeyPress

public java.lang.String getOnKeyPress()

Scripting code that is executed when the user presses and releases a key while the component has focus.


setOnKeyPress

public void setOnKeyPress(java.lang.String onKeyPress)

Scripting code that is executed when the user presses and releases a key while the component has focus.

See Also:
getOnKeyPress()

getOnKeyUp

public java.lang.String getOnKeyUp()

Scripting code that is executed when the user releases a key while the component has focus.


setOnKeyUp

public void setOnKeyUp(java.lang.String onKeyUp)

Scripting code that is executed when the user releases a key while the component has focus.

See Also:
getOnKeyUp()

getOnMouseDown

public java.lang.String getOnMouseDown()

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

Overrides:
getOnMouseDown in class ImageComponent

setOnMouseDown

public void setOnMouseDown(java.lang.String onMouseDown)

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

Overrides:
setOnMouseDown in class ImageComponent
See Also:
getOnMouseDown()

getOnMouseMove

public java.lang.String getOnMouseMove()

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

Overrides:
getOnMouseMove in class ImageComponent

setOnMouseMove

public void setOnMouseMove(java.lang.String onMouseMove)

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

Overrides:
setOnMouseMove in class ImageComponent
See Also:
getOnMouseMove()

getOnMouseOut

public java.lang.String getOnMouseOut()

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

Overrides:
getOnMouseOut in class ImageComponent

setOnMouseOut

public void setOnMouseOut(java.lang.String onMouseOut)

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

Overrides:
setOnMouseOut in class ImageComponent
See Also:
getOnMouseOut()

getOnMouseOver

public java.lang.String getOnMouseOver()

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

Overrides:
getOnMouseOver in class ImageComponent

setOnMouseOver

public void setOnMouseOver(java.lang.String onMouseOver)

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

Overrides:
setOnMouseOver in class ImageComponent
See Also:
getOnMouseOver()

getOnMouseUp

public java.lang.String getOnMouseUp()

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

Overrides:
getOnMouseUp in class ImageComponent

setOnMouseUp

public void setOnMouseUp(java.lang.String onMouseUp)

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

Overrides:
setOnMouseUp in class ImageComponent
See Also:
getOnMouseUp()

getSeverity

public java.lang.String getSeverity()

Specifies the severity of the alarm. Valid values are:

The default value is "ok", which renders no alarm icon.


setSeverity

public void setSeverity(java.lang.String severity)

Specifies the severity of the alarm. default set of severity values are:

Apart from the default set of severities, custom severities are also supported. The default value is "ok", which renders no alarm icon.

See Also:
getSeverity()

getStyle

public java.lang.String getStyle()

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

Overrides:
getStyle in class ImageComponent

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.

Overrides:
setStyle in class ImageComponent
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.

Overrides:
getStyleClass in class ImageComponent

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.

Overrides:
setStyleClass in class ImageComponent
See Also:
getStyleClass()

getText

public java.lang.String getText()

The text description of the alarm.


setText

public void setText(java.lang.String text)

The text description of the alarm.

See Also:
getText()

getTextPosition

public java.lang.String getTextPosition()

Specifies where the text will be placed relative to the image. The valid values currently are "right" or "left". By default, text is placed to the right of the image.


setTextPosition

public void setTextPosition(java.lang.String textPosition)

Specifies where the text will be placed relative to the image. The valid values currently are "right" or "left". By default, text is placed to the right of the image.

See Also:
getTextPosition()

getToolTip

public java.lang.String getToolTip()

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 HTML element.

Overrides:
getToolTip in class ImageComponent

setToolTip

public void setToolTip(java.lang.String toolTip)

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 HTML element.

Overrides:
setToolTip in class ImageComponent
See Also:
getToolTip()

isVisible

public boolean isVisible()

Indicates 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, is true, so HTML for the component HTML is included and visible to the user. If the Alarm component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

Overrides:
isVisible in class ImageComponent

setVisible

public void setVisible(boolean visible)

Indicates 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, is true, so HTML for the component HTML is included and visible to the user. If the Alarm component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

Overrides:
setVisible in class ImageComponent
See Also:
isVisible()

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 ImageComponent

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 ImageComponent


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