eu.webtoolkit.jwt
Class WProgressBar

java.lang.Object
  extended by eu.webtoolkit.jwt.WObject
      extended by eu.webtoolkit.jwt.WWidget
          extended by eu.webtoolkit.jwt.WWebWidget
              extended by eu.webtoolkit.jwt.WInteractWidget
                  extended by eu.webtoolkit.jwt.WProgressBar

public class WProgressBar
extends WInteractWidget

A progress bar.

The progress bar can be used to indicate the progress of a certain operation. The text displayed in the progress bar can be customized by specializing getText().

To use the progress bar, you need to give it a range (minimum and maximum value), and update the progress using setValue().

WProgressBar is an inline widget.

CSS

Using HTML4, the widget is implemented using a set of nested DIVs. The element can be styled using the Wt-progressbar style. It may be styled through the current theme, or you can override the style using internal or external CSS as appropriate.

Note: With the advent of HTML5, this widget will be implemented using the native HTML5 control when available.


Constructor Summary
WProgressBar()
          Creates a progress bar.
WProgressBar(WContainerWidget parent)
          Creates a progress bar.
 
Method Summary
 WString getFormat()
          Returns the progress format string.
 double getMaximum()
          Returns the maximum value.
 double getMinimum()
          Returns the minimum value.
 WString getText()
          Returns the text displayed inside the progress bar.
 double getValue()
          Returns the current progress.
 Signal progressCompleted()
          A signal that indicates when 100% is reached.
 void resize(WLength width, WLength height)
          Resizes the widget.
 void setFormat(java.lang.CharSequence format)
          Sets the progress format string.
 void setMaximum(double maximum)
          Sets the maximum value.
 void setMinimum(double minimum)
          Sets the minimum value.
 void setRange(double minimum, double maximum)
          Sets the range.
 void setState(double minimum, double maximum, double value)
           
 void setValue(double value)
          Sets the current progress.
 void setValueStyleClass(java.lang.String valueStyleClass)
           
 Signal1<java.lang.Double> valueChanged()
          A signal that indicates when the value has changed.
 
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, remove, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted
 
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, callJavaScriptMember, childrenChanged, doJavaScript, domCanBeSaved, enableAjax, escapeText, escapeText, escapeText, escapeText, find, getAttributeValue, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isVisible, jsStringLiteral, jsStringLiteral, refresh, removeScript, removeStyleClass, render, setAttributeValue, setClearSides, setDecorationStyle, setDisabled, setFloatSide, setHidden, setHiddenKeepsGeometry, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPopup, setPositionScheme, setSelectable, setStyleClass, setTabIndex, setToolTip, setVerticalAlignment, updateSignalConnection
 
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
 
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getObjectName, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WProgressBar

public WProgressBar(WContainerWidget parent)
Creates a progress bar.


WProgressBar

public WProgressBar()
Creates a progress bar.

Calls this((WContainerWidget)null)

Method Detail

setMinimum

public void setMinimum(double minimum)
Sets the minimum value.

The minimum value is the value that corresponds to 0%.

The default value is 0.


getMinimum

public double getMinimum()
Returns the minimum value.

See Also:
setMinimum(double minimum)

setMaximum

public void setMaximum(double maximum)
Sets the maximum value.

The maximum value is the value that corresponds to 100%.

The default value is 100.


getMaximum

public double getMaximum()
Returns the maximum value.

See Also:
setMaximum(double maximum)

setRange

public void setRange(double minimum,
                     double maximum)
Sets the range.

See Also:
setMinimum(double minimum), setMaximum(double maximum)

setValue

public void setValue(double value)
Sets the current progress.

value must be a value between getMinimum() and getMaximum().


getValue

public double getValue()
Returns the current progress.


setFormat

public void setFormat(java.lang.CharSequence format)
Sets the progress format string.

The format is used by getText() to indicate the progress value.

The default value is "%.0f %%"


getFormat

public WString getFormat()
Returns the progress format string.

See Also:
setFormat(CharSequence format)

getText

public WString getText()
Returns the text displayed inside the progress bar.

This text must be an XHTML formatted text fragment. The default text prints the current progress using getFormat(). You may want to reimplement this method to display a different text corresponding to the current getValue().


valueChanged

public Signal1<java.lang.Double> valueChanged()
A signal that indicates when the value has changed.

This signal is emitted when setValue() is called.

See Also:
setValue(double value)

progressCompleted

public Signal progressCompleted()
A signal that indicates when 100% is reached.

This signal is emitted when setValue(getMaximum()) is called.

See Also:
setValue(double value)

resize

public void resize(WLength width,
                   WLength height)
Description copied from class: WWidget
Resizes the widget.

Specify a new size for this widget, by specifying width and height. By default a widget has automatic width and height, see WLength#isAuto().

This applies to CSS-based layout, and only block widgets can be given a size reliably.

When inserted in a layout manager, the widget may be informed about its current size using setLayoutSizeAware(). If you have defined a "wtResize()" JavaScript method for the widget, then this method will also be called. operation.

Overrides:
resize in class WWebWidget
See Also:
WWidget.getWidth(), WWidget.getHeight()

setValueStyleClass

public void setValueStyleClass(java.lang.String valueStyleClass)

setState

public void setState(double minimum,
                     double maximum,
                     double value)