|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gerhardb.jibs.obsolete.WaitDialog
public class WaitDialog
Displays a dialog while executing a task in the background. The dialog
remains visible until either the task is complete, or the user cancels
the operation (by pressing the dialog's Cancel button).
In the case where the user cancels the operation, the executing task
(which is a Thread) will be interrupted. It is up to the
task thread to handle its interruption status and terminate itself at
the earliest opportunity. (Java does not have the ability to abort
an executing thread.)
| Field Summary | |
|---|---|
static javax.swing.Icon |
WAIT_ICON
|
| Constructor Summary | |
|---|---|
WaitDialog(long dialogThreshold,
java.lang.String btnMsg)
Constructs a WaitDialog with a specified timeout. |
|
| Method Summary | |
|---|---|
void |
interrupt()
Halts any executing task, and hides this object's dialog if it is displayed. |
void |
show(java.awt.Component parent,
java.lang.Object message,
java.lang.String title,
java.lang.Thread task)
Executes a task and displays a dialog indicating the task is in progress. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final javax.swing.Icon WAIT_ICON
| Constructor Detail |
|---|
public WaitDialog(long dialogThreshold,
java.lang.String btnMsg)
WaitDialog with a specified timeout.
| Method Detail |
|---|
public void show(java.awt.Component parent,
java.lang.Object message,
java.lang.String title,
java.lang.Thread task)
WaitDialog's constructor) and then display
the dialog, if and only if the task has not completed. This
prevents a dialog from "flashing" on the screen and almost
immediately disappearing again when a brief task executes.
This method returns immediately, in all cases. All work is done by launching new threads.
The executing task will be interrupted if the user activates the dialog's Cancel button. It is up to the task to respond to interruption and terminate itself cleanly and promptly.
parent - parent of the dialog which will be displayedmessage - message to display in the dialog; it is displayed
like a JOptionPane messagetitle - the title of the dialog which will be displayedtask - the task to execute in the backgroundpublic void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged in interface javax.swing.event.ChangeListenerpublic void interrupt()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||