SaveReturn printHtml(final File f) {
Future<Object> waiter = mainFrame.getBackgroundExecutor().submit(new Callable<Object>() {
@Override
public Object call() throws Exception {
HTMLBugReporter reporter = new HTMLBugReporter( mainFrame.getProject(), "default.xsl");
reporter.setIsRelaxed(true);
reporter.setOutputStream(UTF8.printStream(new FileOutputStream(f)));
for(BugInstance bug : mainFrame.getBugCollection().getCollection()) {
try {
if (mainFrame.getViewFilter().show(bug)) {
reporter.reportBug(bug);
}
} catch (Exception e) {
e.printStackTrace();
}
}
reporter.finish();
return null;
}
});
try {
waiter.get();