|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.widgetideas.client.ProgressBar
public class ProgressBar
A widget that displays progress on an arbitrary scale.
Nested Class Summary | |
---|---|
static class |
ProgressBar.TextFormatter
A formatter used to format the text displayed in the progress bar widget. |
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.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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 |
setMaxProgress(double maxProgress)
Set the maximum progress. |
void |
setMinProgress(double minProgress)
Set the minimum progress. |
void |
setProgress(double curProgress)
Set the current progress. |
void |
setTextFormatter(ProgressBar.TextFormatter textFormatter)
Set the text formatter. |
void |
setTextVisible(boolean isVisible)
Sets whether the text is visible over the bar. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onUnload, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.widgetideas.client.ResizableWidget |
---|
getElement, isAttached |
Constructor Detail |
---|
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 formatterMethod Detail |
---|
public 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 setMaxProgress(double maxProgress)
maxProgress
- the maximum progresspublic void setMinProgress(double minProgress)
minProgress
- the minimum progresspublic void setProgress(double curProgress)
curProgress
- the current progresspublic void setTextFormatter(ProgressBar.TextFormatter textFormatter)
textFormatter
- the text formatterpublic void setTextVisible(boolean isVisible)
isVisible
- True to show text, false to hide itprotected java.lang.String generateText(double curProgress)
curProgress
- the current progress
protected 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.Widget
protected void resetProgress()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |