public class ExportWorker extends MidicaWorker
This class is used to export a file in the background while a WaitView
is shown.
This worker is executed in the background before the (blocking) setVisible() method of the (modal) waiting dialog is called. That causes the execution of doInBackground()
that exports the file.
After the export work is finished, MidicaWorker.done()
is called and closes the waiting dialog.
Modifier and Type | Field and Description |
---|---|
private Exporter |
exporter |
private java.io.File |
file |
private ExportResult |
result |
Constructor and Description |
---|
ExportWorker(WaitView view,
Exporter exporter,
java.io.File file)
Creates an export worker that exports a file in the background while a waiting dialog is shown.
|
Modifier and Type | Method and Description |
---|---|
protected ExportException |
doInBackground()
Exports the file in the background.
|
ExportResult |
getResult()
Returns the export result, if available, or null if an ExportException has occurred.
|
done
private Exporter exporter
private java.io.File file
private ExportResult result
public ExportWorker(WaitView view, Exporter exporter, java.io.File file)
Creates an export worker that exports a file in the background while a waiting dialog is shown.
view
- The waiting dialog.exporter
- The exporter do be executed in the background.file
- The file to be exported.protected ExportException doInBackground()
Exports the file in the background. This method is executed after calling SwingWorker.execute()
.
doInBackground
in class MidicaWorker
public ExportResult getResult()
Returns the export result, if available, or null if an ExportException has occurred.