|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.dialogs.ProgressBar
The ProgressBar
provides the user with feedback while a
long-running process is in progress. The dialog consists of a label
known as the progressText, a progress indicator, and another label known
as the stepText. This layout follows the standards in the Oracle Dialogs
User Interface Specification, Version 2.0 Dated May 10, 2001.
The progress indicator displayed is either the javax.swing.JProgressBar
or the Bali BusyBar, depending on a value passed in the constructor.
The BusyBar should be used when you cannot estimate the amount of work
to be done or remaining while the long-running process is executing.
Client code must implement the Runnable interface in order to use the
ProgressBar
. The ProgressBar will create a new thread and
invoke the run() method in the Runnable passed in via the constructor.
This is done so the UI can be repainted while the long-running process is
executing.
Typical implementation: ### describe here ###
Constructor Summary | |
ProgressBar(java.awt.Component parent,
java.lang.String dialogTitle,
java.lang.Runnable runnable,
boolean useBusyBar)
Constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
This is invoked when an action is performed. |
boolean |
hasUserCancelled()
The client code's run() method that implements the long-running process should call this method to determine if the user has pressed the Cancel button on the ProgressBar's dialog to terminate the long-running process. |
boolean |
isCancelable()
|
void |
run()
The entrypoint for the thread that executes the long-running process. |
void |
setCancelable(boolean canCancel)
|
void |
setDoneStatus()
The client code should call this when the long-running process is complete. |
void |
sleepForUIToRepaint()
The client code should call this in it's run() method that implements the long-running process. |
void |
start(java.lang.String initialText,
java.lang.String stepText)
Starts the ProgressBar. |
void |
updateProgress(int completionStatus,
java.lang.String progressText,
java.lang.String stepText)
The client code's run() method that implements the long-running process should use this method to update the ProgressBar to indicate the progress made in the long-running process. |
void |
updateProgress(java.lang.String progressText,
java.lang.String stepText)
The client code's run() method that implements the long-running process should use this method to update the ProgressBar to indicate the progress made in the long-running process. |
void |
waitUntilDone()
The client code should call this to wait until the long-running process is complete. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProgressBar(java.awt.Component parent, java.lang.String dialogTitle, java.lang.Runnable runnable, boolean useBusyBar)
parent
- The UI object to use as the ProgressBar dialog's parentdialogTitle
- The title to use for the ProgressBar dialogrunnable
- The Runnable object whose run() method implements the
long-running processuseBusyBar
- Set to true when the BusyBar is to be used;
false when the JProgressBar is to be usedMethod Detail |
public void setCancelable(boolean canCancel)
public boolean isCancelable()
public void start(java.lang.String initialText, java.lang.String stepText)
initialText
- The text to display just above the progress
indicator. An example might be "Downloading components."stepText
- The text to display just below the progress
indicator. An example might be "Retrieving file abc.jar."public void updateProgress(int completionStatus, java.lang.String progressText, java.lang.String stepText)
completionStatus
- The amount of progress that has been made.progressText
- The text to display just above the progress
indicator. If a null string or zero-length string is passed
in the text will not be updated.stepText
- The text to display just below the progress indicator.
If a null string or zero-length string is passed
in the text will not be updated.public void updateProgress(java.lang.String progressText, java.lang.String stepText)
progressText
- The text to display just above the progress
indicator. If a null string or zero-length string is passed
in the text will not be updated.stepText
- The text to display just below the progress indicator.
If a null string or zero-length string is passed
in the text will not be updated.public boolean hasUserCancelled()
public void sleepForUIToRepaint()
public void waitUntilDone()
public void setDoneStatus()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- the action eventpublic void run()
run
in interface java.lang.Runnable
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.