public class ProgressBar extends com.google.gwt.user.client.ui.Widget implements ResizableWidget
| Modifier and Type | Class and Description |
|---|---|
static class |
ProgressBar.TextFormatter
A formatter used to format the text displayed in the progress bar widget.
|
| Constructor and Description |
|---|
ProgressBar()
Create a progress bar with default range of 0 to 100.
|
ProgressBar(double curProgress)
Create a progress bar with an initial progress and a default range of 0 to
100.
|
ProgressBar(double minProgress,
double maxProgress)
Create a progress bar within the given range.
|
ProgressBar(double minProgress,
double maxProgress,
double curProgress)
Create a progress bar within the given range starting at the specified
progress amount.
|
ProgressBar(double minProgress,
double maxProgress,
double curProgress,
ProgressBar.TextFormatter textFormatter)
Create a progress bar within the given range starting at the specified
progress amount.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
generateText(double curProgress)
Generate the text to display within the progress bar.
|
protected com.google.gwt.user.client.Element |
getBarElement()
Get the bar element.
|
double |
getMaxProgress()
Get the maximum progress.
|
double |
getMinProgress()
Get the minimum progress.
|
double |
getPercent()
Get the current percent complete, relative to the minimum and maximum
values.
|
double |
getProgress()
Get the current progress.
|
protected com.google.gwt.user.client.Element |
getTextElement()
Get the text element.
|
ProgressBar.TextFormatter |
getTextFormatter()
Get the text formatter.
|
boolean |
isTextVisible()
Check whether the text is visible or not.
|
protected void |
onLoad()
This method is called immediately after a widget becomes attached to the
browser's document.
|
void |
onResize(int width,
int height)
This method is called when the dimensions of the parent element change.
|
protected void |
onUnload() |
void |
redraw()
Redraw the progress bar when something changes the layout.
|
protected void |
resetProgress()
Reset the progress text based on the current min and max progress range.
|
void |
setBarStyleName(java.lang.String barClassName) |
void |
setMaxProgress(double maxProgress)
Set the maximum progress.
|
void |
setMinProgress(double minProgress)
Set the minimum progress.
|
void |
setProgress(double curProgress)
Set the current progress.
|
void |
setTextFirstHalfStyleName(java.lang.String textFirstHalfClassName) |
void |
setTextFormatter(ProgressBar.TextFormatter textFormatter)
Set the text formatter.
|
void |
setTextSecondHalfStyleName(java.lang.String textSecondHalfClassName) |
void |
setTextStyleName(java.lang.String textClassName) |
void |
setTextVisible(boolean textVisible)
Sets whether the text is visible over the bar.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElement, isAttachedpublic ProgressBar()
public ProgressBar(double curProgress)
curProgress - the current progresspublic ProgressBar(double minProgress,
double maxProgress)
minProgress - the minimum progressmaxProgress - the maximum progresspublic ProgressBar(double minProgress,
double maxProgress,
double curProgress)
minProgress - the minimum progressmaxProgress - the maximum progresscurProgress - the current progresspublic ProgressBar(double minProgress,
double maxProgress,
double curProgress,
ProgressBar.TextFormatter textFormatter)
minProgress - the minimum progressmaxProgress - the maximum progresscurProgress - the current progresstextFormatter - the text formatterpublic double getMaxProgress()
public double getMinProgress()
public double getPercent()
public double getProgress()
public ProgressBar.TextFormatter getTextFormatter()
public boolean isTextVisible()
public void onResize(int width,
int height)
onResize in interface ResizableWidgetwidth - the new client width of the elementheight - the new client height of the elementpublic void redraw()
public void setBarStyleName(java.lang.String barClassName)
public void setMaxProgress(double maxProgress)
maxProgress - the maximum progresspublic void setMinProgress(double minProgress)
minProgress - the minimum progresspublic void setProgress(double curProgress)
curProgress - the current progresspublic void setTextFirstHalfStyleName(java.lang.String textFirstHalfClassName)
public void setTextFormatter(ProgressBar.TextFormatter textFormatter)
textFormatter - the text formatterpublic void setTextSecondHalfStyleName(java.lang.String textSecondHalfClassName)
public void setTextStyleName(java.lang.String textClassName)
public void setTextVisible(boolean textVisible)
textVisible - True to show text, false to hide itprotected java.lang.String generateText(double curProgress)
curProgress - the current progressprotected com.google.gwt.user.client.Element getBarElement()
protected com.google.gwt.user.client.Element getTextElement()
protected void onLoad()
onLoad in class com.google.gwt.user.client.ui.Widgetprotected void onUnload()
onUnload in class com.google.gwt.user.client.ui.Widgetprotected void resetProgress()