Class WProgressBar
- java.lang.Object
-
- eu.webtoolkit.jwt.WObject
-
- eu.webtoolkit.jwt.WWidget
-
- eu.webtoolkit.jwt.WWebWidget
-
- eu.webtoolkit.jwt.WInteractWidget
-
- 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
inlinewidget.Note: With the advent of HTML5, this widget will be implemented using the native HTML5 control when available.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WProgressBar()Creates a progress bar.WProgressBar(WContainerWidget parentContainer)Creates a progress bar.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WStringgetFormat()Returns the progress format string.doublegetMaximum()Returns the maximum value.doublegetMinimum()Returns the minimum value.WStringgetText()Returns the text displayed inside the progress bar.doublegetValue()Returns the current progress.SignalprogressCompleted()A signal that indicates when 100% is reached.voidresize(WLength width, WLength height)Resizes the widget.voidsetFormat(java.lang.CharSequence format)Sets the progress format string.voidsetMaximum(double maximum)Sets the maximum value.voidsetMinimum(double minimum)Sets the minimum value.voidsetRange(double minimum, double maximum)Sets the range.voidsetState(double minimum, double maximum, double value)voidsetValue(double value)Sets the current progress.voidsetValueStyleClass(java.lang.String valueStyleClass)Updates the style class of the bar part of theWProgressBar.protected voidupdateBar(DomElement bar)Update the progress bar itself.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, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, remove, render, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
-
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, enableAjax, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getDomChanges, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isCanReceiveFocus, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, refresh, removeScript, removeStyleClass, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
-
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, 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
getObjectName, setFormData
-
-
-
-
Constructor Detail
-
WProgressBar
public WProgressBar(WContainerWidget parentContainer)
Creates a progress bar.
-
WProgressBar
public WProgressBar()
Creates a progress bar.
-
-
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.
-
setValue
public void setValue(double value)
Sets the current progress.valuemust be a value betweengetMinimum()andgetMaximum().
-
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 currentgetValue().
-
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(maximum()) is called.
- See Also:
setValue(double value)
-
resize
public void resize(WLength width, WLength height)
Description copied from class:WWidgetResizes the widget.Specifies a fixed size for this widget, setting CSS
widthandheightproperties. By default a widget has automatic width and height, which sets a size for the widget following CSS rules.When the widget is not managed by a layout manager, the automatic (natural) size of a widget depends on whether the widget is a block or inline widget:
- a block widget takes by default the width of the parent, and the height that it needs based on its contents
- an inline widget takes the width and height that it needs based on its contents (possibly wrapping over multiple lines). The width and height of an inline widget cannot be changed (by the letter of CSS, although most browsers will react to it in varying ways).
When inserted in a layout manager, the size set will be used as a widget's preferred size, but the widget may be given a different size by the layout manager based on available space and stretch factors. The actual size given by a layout manager may be retrieved by making the widget "layout size aware", using
setLayoutSizeAware(). If you have defined a"wtResize()"JavaScript method for the widget, then this method will also be called.The default width and height of a widget is
WLength.Auto.- Overrides:
resizein classWWebWidget- See Also:
WWidget.getWidth(),WWidget.getHeight()
-
setValueStyleClass
public void setValueStyleClass(java.lang.String valueStyleClass)
Updates the style class of the bar part of theWProgressBar.This can be used to style the bar part of the
WProgressBar, e.g. "progress-bar-success" or "progress-bar-danger".
-
setState
public void setState(double minimum, double maximum, double value)
-
updateBar
protected void updateBar(DomElement bar)
Update the progress bar itself.Will be called whenever the value changes, and changes the width of the progress bar accordingly.
You can reimplement this method to apply certain style changes to the progress bar according to the value. Don't forget to call
updateBar()if you still want the width to change.
-
-