public void sendReport(final Report report) {
Thread thread = new Thread(new Runnable() {
public void run() {
ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(ReportController.class, "ReportController.status.sending"));
try {
handle.start();
Document doc = buildReportDocument(report);
if (doc != null) {
if (sendDocument(doc)) {
handle.finish();
DialogDisplayer.getDefault().notify(
new NotifyDescriptor.Message(NbBundle.getMessage(ReportController.class, "ReportController.status.sent"),
NotifyDescriptor.INFORMATION_MESSAGE));
return;
}
}
} catch (Exception e) {
e.printStackTrace();
}
handle.finish();
DialogDisplayer.getDefault().notify(
new NotifyDescriptor.Message(NbBundle.getMessage(ReportController.class, "ReportController.status.failed"),
NotifyDescriptor.WARNING_MESSAGE));
}
}, "Exception Reporter");