com.sun.webui.jsf.component
Class ProgressBar

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.ProgressBar
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class ProgressBar
extends javax.faces.component.UIOutput
implements javax.faces.component.NamingContainer

The ProgressBar component is used to create a progress indicator.

Progress Bar component consists of three progress bar designs: "Simple Determinate", "Indeterminate" and a "Busy" indicator. The "Simple Determinate" and "Indeterminate" progress bars are represented as graphical bars. The "Simple Determinate" progress bar is used to represent the percentage of given task that has been completed. The "Indeterminate" progress bar is used when estimates of task completion cannot be provided, yet the task is being performed. Progress bars may also include a textual description of the operation; a textual description of the current operation status; and any related controls such as a "Pause", "Resume" and/or "Cancel" buttons to halt the associated task or job. The "Busy" indicator is used when space is very constrained.

In the rendered HTML page, the progressbar is created with <div> elements. The progress consists of the following areas:


Field Summary
static java.lang.String BOTTOMTASK_CONTROL_FACET
          The facet name for the left control.
static java.lang.String BOTTOMTEXT_FACET
          The facet name for the bottom text.
static java.lang.String BUSY_ICON_ID
          The component id for the actions separator icon.
static java.lang.String BUSY_INDICATOR
           
static java.lang.String DETERMINATE
           
static java.lang.String INDETERMINATE
           
static java.lang.String RIGHTTASK_CONTROL_FACET
          The facet name for the right control.
static java.lang.String TASK_CANCELED
           
static java.lang.String TASK_COMPLETED
           
static java.lang.String TASK_FAILED
           
static java.lang.String TASK_NOT_STARTED
           
static java.lang.String TASK_PAUSED
           
static java.lang.String TASK_RESUMED
           
static java.lang.String TASK_RUNNING
           
static java.lang.String TASK_STOPPED
           
static java.lang.String TOPTEXT_FACET
          The facet name for the top text.
 
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
ProgressBar()
          Creates a new instance of ProgressBar
 
Method Summary
 javax.faces.component.UIComponent getBusyIcon()
          Deprecated.  
 javax.faces.context.FacesContext getContext()
           
 javax.faces.convert.Converter getConverter()
           
 java.lang.String getDescription()
          Text to describe the operation that is monitored by the progress bar.
 java.lang.String getFailedStateText()
          Text to be displayed along with an icon when the task fails.
 java.lang.String getFamily()
          Return the family for this component.
 int getHeight()
          Number of pixels for the height of the progress bar animation.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by this component.
 java.lang.String getLogMessage()
          Text to be displayed in a text area at the bottom of the progress bar component.
 javax.faces.component.UIComponent getLogMsgComponent(ProgressBar component)
          This function creates one textarea component for displaying log messages.
 int getProgress()
          An integer that indicates the completion percentage of the task.
 java.lang.String getProgressImageUrl()
          URL to an image to use instead of the default image for the progress indicator.
 int getRefreshRate()
          The number of milliseconds between updates to the progress bar.
 java.lang.String getRendererType()
           
 java.lang.String getStatus()
          Text to be displayed at the bottom of the progress bar, for the status of the operation.
 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.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 java.lang.String getTaskState()
          A string representing the state of the task associated with this progress bar.
 java.lang.String getToolTip()
          Sets the value of the title attribute for the HTML element.
 java.lang.String getType()
          Type of progress bar.
 java.lang.Object getValue()
           
 int getWidth()
          Number of pixels for the width of the progress bar animation.
 boolean isOverlayAnimation()
          Set to true to display the operation progress text superimposed on the progress bar animation.
 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 setDescription(java.lang.String description)
          Text to describe the operation that is monitored by the progress bar.
 void setFailedStateText(java.lang.String failedStateText)
          Text to be displayed along with an icon when the task fails.
 void setHeight(int height)
          Number of pixels for the height of the progress bar animation.
 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 setLogMessage(java.lang.String logMessage)
          Text to be displayed in a text area at the bottom of the progress bar component.
 void setOverlayAnimation(boolean overlayAnimation)
          Set to true to display the operation progress text superimposed on the progress bar animation.
 void setProgress(int progress)
          An integer that indicates the completion percentage of the task.
 void setProgressImageUrl(java.lang.String progressImageUrl)
          URL to an image to use instead of the default image for the progress indicator.
 void setRefreshRate(int refreshRate)
          The number of milliseconds between updates to the progress bar.
 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 setStatus(java.lang.String status)
          Text to be displayed at the bottom of the progress bar, for the status of the operation.
 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 setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setTaskState(java.lang.String taskState)
          A string representing the state of the task associated with this progress bar.
 void setToolTip(java.lang.String toolTip)
          Sets the value of the title attribute for the HTML element.
 void setType(java.lang.String type)
          Type of progress bar.
 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 setWidth(int width)
          Number of pixels for the width of the progress bar animation.
 
Methods inherited from class javax.faces.component.UIOutput
getLocalValue, setConverter, 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, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOPTEXT_FACET

public static final java.lang.String TOPTEXT_FACET
The facet name for the top text.

See Also:
Constant Field Values

BOTTOMTEXT_FACET

public static final java.lang.String BOTTOMTEXT_FACET
The facet name for the bottom text.

See Also:
Constant Field Values

RIGHTTASK_CONTROL_FACET

public static final java.lang.String RIGHTTASK_CONTROL_FACET
The facet name for the right control.

See Also:
Constant Field Values

BOTTOMTASK_CONTROL_FACET

public static final java.lang.String BOTTOMTASK_CONTROL_FACET
The facet name for the left control.

See Also:
Constant Field Values

TASK_COMPLETED

public static java.lang.String TASK_COMPLETED

TASK_PAUSED

public static java.lang.String TASK_PAUSED

TASK_STOPPED

public static java.lang.String TASK_STOPPED

TASK_RUNNING

public static java.lang.String TASK_RUNNING

TASK_RESUMED

public static java.lang.String TASK_RESUMED

TASK_CANCELED

public static java.lang.String TASK_CANCELED

TASK_FAILED

public static java.lang.String TASK_FAILED

TASK_NOT_STARTED

public static java.lang.String TASK_NOT_STARTED

DETERMINATE

public static java.lang.String DETERMINATE

INDETERMINATE

public static java.lang.String INDETERMINATE

BUSY_INDICATOR

public static java.lang.String BUSY_INDICATOR

BUSY_ICON_ID

public static final java.lang.String BUSY_ICON_ID
The component id for the actions separator icon.

See Also:
Constant Field Values
Constructor Detail

ProgressBar

public ProgressBar()
Creates a new instance of ProgressBar

Method Detail

getContext

public javax.faces.context.FacesContext getContext()

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

getBusyIcon

public javax.faces.component.UIComponent getBusyIcon()
Deprecated. 

Get the busy icon.

Returns:
The busy icon.

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 javax.faces.component.UIComponentBase

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 javax.faces.component.UIComponentBase

getValue

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

getConverter

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

getLogMsgComponent

public javax.faces.component.UIComponent getLogMsgComponent(ProgressBar component)
This function creates one textarea component for displaying log messages.

Returns:
UIComponent

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.


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.


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.

See Also:
getToolTip()

getDescription

public java.lang.String getDescription()

Text to describe the operation that is monitored by the progress bar.


setDescription

public void setDescription(java.lang.String description)

Text to describe the operation that is monitored by the progress bar.

See Also:
getDescription()

getFailedStateText

public java.lang.String getFailedStateText()

Text to be displayed along with an icon when the task fails.


setFailedStateText

public void setFailedStateText(java.lang.String failedStateText)

Text to be displayed along with an icon when the task fails.

See Also:
getFailedStateText()

getHeight

public int getHeight()

Number of pixels for the height of the progress bar animation. The default is 14.


setHeight

public void setHeight(int height)

Number of pixels for the height of the progress bar animation. The default is 14.

See Also:
getHeight()

getLogMessage

public java.lang.String getLogMessage()

Text to be displayed in a text area at the bottom of the progress bar component.


setLogMessage

public void setLogMessage(java.lang.String logMessage)

Text to be displayed in a text area at the bottom of the progress bar component.

See Also:
getLogMessage()

isOverlayAnimation

public boolean isOverlayAnimation()

Set to true to display the operation progress text superimposed on the progress bar animation.


setOverlayAnimation

public void setOverlayAnimation(boolean overlayAnimation)

Set to true to display the operation progress text superimposed on the progress bar animation.

See Also:
isOverlayAnimation()

getProgress

public int getProgress()

An integer that indicates the completion percentage of the task.


setProgress

public void setProgress(int progress)

An integer that indicates the completion percentage of the task.

See Also:
getProgress()

getProgressImageUrl

public java.lang.String getProgressImageUrl()

URL to an image to use instead of the default image for the progress indicator.


setProgressImageUrl

public void setProgressImageUrl(java.lang.String progressImageUrl)

URL to an image to use instead of the default image for the progress indicator.

See Also:
getProgressImageUrl()

getRefreshRate

public int getRefreshRate()

The number of milliseconds between updates to the progress bar.


setRefreshRate

public void setRefreshRate(int refreshRate)

The number of milliseconds between updates to the progress bar.

See Also:
getRefreshRate()

getStatus

public java.lang.String getStatus()

Text to be displayed at the bottom of the progress bar, for the status of the operation.


setStatus

public void setStatus(java.lang.String status)

Text to be displayed at the bottom of the progress bar, for the status of the operation.

See Also:
getStatus()

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()

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()

getTaskState

public java.lang.String getTaskState()

A string representing the state of the task associated with this progress bar. Default value for taskState is not_started. Valid values are:

not_started
running
paused
resumed
stopped
canceled
failed
completed


setTaskState

public void setTaskState(java.lang.String taskState)

A string representing the state of the task associated with this progress bar. Valid values are:

not_started
running
paused
resumed
stopped
canceled
failed
completed

See Also:
getTaskState()

getType

public java.lang.String getType()

Type of progress bar. Value must be one of the following:
"DETERMINATE" for horizontal bar showing percent complete
"INDETERMINATE" for horizontal bar without percent complete
"BUSY" for simple activity indicator


setType

public void setType(java.lang.String type)

Type of progress bar. Value must be one of the following:
"DETERMINATE" for horizontal bar showing percent complete
"INDETERMINATE" for horizontal bar without percent complete
"BUSY" for simple activity indicator

See Also:
getType()

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()

getWidth

public int getWidth()

Number of pixels for the width of the progress bar animation. The default is 184.


setWidth

public void setWidth(int width)

Number of pixels for the width of the progress bar animation. The default is 184.

See Also:
getWidth()

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


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