page1.saveWidgetValues();
return createReport();
}
private boolean createReport() {
final ICoverageSession session = page1.getSelectedSession();
final ISessionExporter exporter = CoverageTools.getExporter(session);
exporter.setFormat(page1.getExportFormat());
exporter.setDestination(page1.getDestination());
final IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
try {
exporter.export(monitor);
} catch (Exception e) {
throw new InvocationTargetException(e);
}
}
};
try {
getContainer().run(true, true, op);
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException ite) {
final Throwable ex = ite.getTargetException();
EclEmmaUIPlugin.log(ex);
final String title = UIMessages.ExportReportErrorDialog_title;
String msg = UIMessages.ExportReportErrorDialog_message;
msg = NLS.bind(msg, session.getDescription());
final IStatus status;
if (ex instanceof CoreException) {
status = ((CoreException) ex).getStatus();
} else {
status = EclEmmaUIPlugin.errorStatus(String.valueOf(ex.getMessage()),