com.extjs.gxt.ui.client.widget
Class ProgressBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.ProgressBar
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class ProgressBar
extends BoxComponent

An updateable progress bar component. The progress bar supports two different modes: manual and automatic.

In manual mode, you are responsible for showing, updating (via updateProgress(double, java.lang.String)) and clearing the progress bar as needed from your own code. This method is most appropriate when you want to show progress throughout an operation that has predictable points of interest at which you can update the control.

In automatic mode, you simply call auto and let the progress bar run indefinitely, only clearing it once the operation is complete. You can optionally have the progress bar wait for a specific amount of time and then clear itself. Automatic mode is most appropriate for timed operations or asynchronous operations in which you have no need for indicating intermediate progress.

Inherited Events:
BoxComponent Move
BoxComponent Resize
Component Enable
Component Disable
Component BeforeHide
Component Hide
Component BeforeShow
Component Show
Component Attach
Component Detach
Component BeforeRender
Component Render
Component BrowserEvent
Component BeforeStateRestore
Component StateRestore
Component BeforeStateSave
Component SaveState


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ProgressBar()
          Creates a new progress bar.
 
Method Summary
 ProgressBar auto()
          Initiates an auto-updating progress bar using the current duration, increment, and interval.
 int getDuration()
          Returns the duration.
 int getIncrement()
          Returns the bar's increment value.
 int getInterval()
          Returns the bar's interval value.
 double getValue()
          Returns the current value.
 boolean isRunning()
          Returns true if the progress bar is currently in a auto operation.
protected  void onAttach()
           
protected  void onDetach()
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void onResize(int width, int height)
          Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.
 ProgressBar reset()
          Resets the progress bar value to 0 and text to empty string.
 void setDuration(int duration)
          The length of time in milliseconds that the progress bar should run before resetting itself (defaults to DEFAULT, in which case it will run indefinitely until reset is called)
 void setIncrement(int increment)
          The number of progress update segments to display within the progress bar (defaults to 10).
 void setInterval(int interval)
          Sets the length of time in milliseconds between each progress update (defaults to 300 ms).
 ProgressBar updateProgress(double value, java.lang.String text)
          Updates the progress bar value, and optionally its text.
 void updateText(java.lang.String text)
          Updates the progress bar text.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, afterRender, createComponentEvent, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, doAttachChildren, doDetachChildren, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, notifyHide, notifyShow, onBrowserEvent, onComponentEvent, onDetachHelper, onDisable, onEnable, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTabIndex, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgressBar

public ProgressBar()
Creates a new progress bar.

Method Detail

auto

public ProgressBar auto()
Initiates an auto-updating progress bar using the current duration, increment, and interval.

Returns:
this

getDuration

public int getDuration()
Returns the duration.

Returns:
the duration

getIncrement

public int getIncrement()
Returns the bar's increment value.

Returns:
the increment the increment

getInterval

public int getInterval()
Returns the bar's interval value.

Returns:
the interval in millseconds

getValue

public double getValue()
Returns the current value.

Returns:
the value

isRunning

public boolean isRunning()
Returns true if the progress bar is currently in a auto operation.

Returns:
true if waiting, else false

reset

public ProgressBar reset()
Resets the progress bar value to 0 and text to empty string.

Returns:
this

setDuration

public void setDuration(int duration)
The length of time in milliseconds that the progress bar should run before resetting itself (defaults to DEFAULT, in which case it will run indefinitely until reset is called)

Parameters:
duration - the duration in milliseconds

setIncrement

public void setIncrement(int increment)
The number of progress update segments to display within the progress bar (defaults to 10). If the bar reaches the end and is still updating, it will automatically wrap back to the beginning.

Parameters:
increment - the new increment

setInterval

public void setInterval(int interval)
Sets the length of time in milliseconds between each progress update (defaults to 300 ms).

Parameters:
interval - the interval to set

updateProgress

public ProgressBar updateProgress(double value,
                                  java.lang.String text)
Updates the progress bar value, and optionally its text. If the text argument is not specified, any existing text value will be unchanged. To blank out existing text, pass "". Note that even if the progress bar value exceeds 1, it will never automatically reset -- you are responsible for determining when the progress is complete and calling reset() to clear and/or hide the control.

Parameters:
value - A value between 0 and 1 (e.g., .5, defaults to 0)
text - The string to display in the progress text element or null.
Returns:
this

updateText

public void updateText(java.lang.String text)
Updates the progress bar text. If specified, textEl will be updated, otherwise the progress bar itself will display the updated text.

Parameters:
text - The string to display in the progress text element

onAttach

protected void onAttach()
Overrides:
onAttach in class Component

onDetach

protected void onDetach()
Overrides:
onDetach in class Component

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class Component
Parameters:
target - the target element
index - the insert location

onResize

protected void onResize(int width,
                        int height)
Description copied from class: BoxComponent
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.

Overrides:
onResize in class BoxComponent
Parameters:
width - the width
height - the height