Package PamUtils.worker
Class PamWorker<T>
java.lang.Object
PamUtils.worker.PamWorker<T>
Wrapper around a SwingWorker so it's easy to launch a background thread that will
update a modal dialog with a progress bar and some text
- Author:
- Doug Gillespie
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPamWorker
(PamWorkWrapper<T> pamWorkWrapper) Create a PamWorker without a swing dialog.PamWorker
(PamWorkWrapper<T> pamWorkWrapper, Window parentFrame, int nTextRows, String title) -
Method Summary
Modifier and TypeMethodDescriptionGet the PAM progress property.Get the exception if one was thrown in the worker thread.boolean
calls Exception.printStackTrace() if an excpetion is thrown in the worker thread.void
setDumpException
(boolean dumpException) calls Exception.printStackTrace() if an exception is thrown in the worker thread.boolean
start()
Start the worker thread.void
update
(PamWorkProgressMessage progressMessage)
-
Constructor Details
-
PamWorker
- Parameters:
pamWorkWrapper
- wrapper round callback and worker functionsparentFrame
- parent frame of progress dialognTextRows
- number of rows of text for progress messagestitle
- dialog title
-
PamWorker
Create a PamWorker without a swing dialog.- Parameters:
pamWorkWrapper
- wrapper round callback and worker functionsparentFrame
- parent frame of progress dialognTextRows
- number of rows of text for progress messagestitle
- dialog title
-
-
Method Details
-
start
public boolean start()Start the worker thread.- Returns:
- true of the thread is started. flase if the thread is done, cancelled or running.
-
getPamWorkDialog
-
getBackgroundWorker
-
update
-
getPamWorkProgress
Get the PAM progress property.- Returns:
- class with the progress properties of the worker.
-
isDumpException
public boolean isDumpException()calls Exception.printStackTrace() if an excpetion is thrown in the worker thread.
Default is true.- Returns:
- the dumpException
-
setDumpException
public void setDumpException(boolean dumpException) calls Exception.printStackTrace() if an exception is thrown in the worker thread.
Default is true.- Parameters:
dumpException
- the dumpException to set
-
getThrownException
Get the exception if one was thrown in the worker thread.- Returns:
- the thrownException
-