|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.tentackle.ui.WorkerThread
public class WorkerThread
A worker thread.
The thread will dispose a dialog if terminated.
The specified Runnable must either monitor whether the thread
got interrupt()ed by checking Thread.isInterrupted()
or override Thread.interrupt() and terminate the thread gracefully.
WorkerDialog| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
WorkerThread(Runnable todo,
boolean modal,
String title)
Creates a worker thread using an WorkerDialog. |
|
WorkerThread(Runnable todo,
boolean modal,
String title,
JDialog workerDialog)
Creates a worker thread. |
|
WorkerThread(Runnable todo,
String title)
Creates a worker thread using a modal WorkerDialog
and a given title.This is the default case. |
|
| Method Summary | |
|---|---|
JDialog |
getWorkerDialog()
Gets the worker dialog. |
void |
run()
If this thread was constructed using a separate Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns. |
void |
start()
Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread. |
void |
startAndWait()
Starts the workerthread and waits until the modal worker dialog is closed. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WorkerThread(Runnable todo,
boolean modal,
String title,
JDialog workerDialog)
todo - the runnable for this threadmodal - true if dialog should be set to modaltitle - the dialog's title, null if leave unchangedworkerDialog - the dialog that will be disposed when thread terminates,
null if WorkerDialog
public WorkerThread(Runnable todo,
boolean modal,
String title)
WorkerDialog.
todo - what's to do in the run-method?modal - true if dialog should be set to modaltitle - the dialog's title, null if leave unchanged
public WorkerThread(Runnable todo,
String title)
WorkerDialog
and a given title.
todo - what's to do in the run-method?title - the dialog's title, null if leave unchanged| Method Detail |
|---|
public JDialog getWorkerDialog()
WorkerDialog)public void run()
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns.
Subclasses of Thread should override this method.
Overridden to dispose the dialog.
run in interface Runnablerun in class ThreadThread.start(),
Thread.stop(),
Thread.Thread(ThreadGroup, Runnable, String)public void start()
run method of this thread.
The result is that two threads are running concurrently: the
current thread (which returns from the call to the
start method) and the other thread (which executes its
run method).
It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.
Overridden to show the dialog. The dialog will be shown by invokeLater. This allows the method to return immediately even if the dialog is modal.
start in class ThreadThread.run(),
Thread.stop()public void startAndWait()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||