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 |
---|---|
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.
|
ProgressBar.TextFormatter |
getTextFormatter()
Get the text formatter.
|
boolean |
isTextVisible()
Check whether the text is visible or not.
|
void |
onResize(int width,
int height)
This method is called when the dimensions of the parent element change.
|
void |
redraw()
Redraw the progress bar when something changes the layout.
|
void |
setBarStyleName(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(String textFirstHalfClassName) |
void |
setTextFormatter(ProgressBar.TextFormatter textFormatter)
Set the text formatter.
|
void |
setTextSecondHalfStyleName(String textSecondHalfClassName) |
void |
setTextStyleName(String textClassName) |
void |
setTextVisible(boolean textVisible)
Sets whether the text is visible over the bar.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getElement, isAttached
public 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 ResizableWidget
width
- the new client width of the elementheight
- the new client height of the elementpublic void redraw()
public void setBarStyleName(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(String textFirstHalfClassName)
public void setTextFormatter(ProgressBar.TextFormatter textFormatter)
textFormatter
- the text formatterpublic void setTextSecondHalfStyleName(String textSecondHalfClassName)
public void setTextStyleName(String textClassName)
public void setTextVisible(boolean textVisible)
textVisible
- True to show text, false to hide itCopyright © 2017. All rights reserved.