dialog.setVisible(true);
if (!dialog.isCancelled()) {
ReportConfig config = reportTask.getConfiguration();
File source = new File(config.getSourceDirectory());
File target = new File(config.getReportFile());
ListingProcessor proc = new ListingProcessor(new File[] { source },
config.isRecursive(), target, config.getTransformType());
proc.setVerbose(true);
ListingProgressDialog lpd = new ListingProgressDialog(dialog);
if ((config.getTransformType() & ListingProcessor.REPORT_OTHER) > 0) {
lpd.setModal(false);
}
centerDialog(lpd);
proc.setListingProgressListener(lpd);
try {
Thread thread = proc.start();
lpd.setVisible(true);
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
if (config.getTransformType() == ListingProcessor.REPORT_OTHER
&& !lpd.abort()) {
/*
* Now we need to transform.
*/
try {
lpd
.appendMessage("\n"
+ LangageManager
.getProperty("listgen.transformation.start"));
FileOutputStream fos = new FileOutputStream(target);
ByteArrayInputStream bais = new ByteArrayInputStream(proc
.getLister().getContent().getBytes());
XslTransformer.process(bais, fos, config
.getTransformTarget());
fos.flush();
fos.close();