final int work = session.getScope().size();
monitor.beginTask(
NLS.bind(CoreMessages.ExportingSession_task, session.getDescription()),
work * 2);
final SessionAnalyzer analyzer = new SessionAnalyzer();
final IJavaModelCoverage modelCoverage = analyzer.processSession(session,
new SubProgressMonitor(monitor, work));
final IReportVisitor formatter = createFormatter();
formatter
.visitInfo(analyzer.getSessionInfos(), analyzer.getExecutionData());
final IReportGroupVisitor modelgroup = formatter.visitGroup(session
.getDescription());
for (IJavaProject project : modelCoverage.getProjects()) {
final IReportGroupVisitor projectgroup = modelgroup.visitGroup(project
.getElementName());
for (IPackageFragmentRoot root : project.getPackageFragmentRoots()) {
final IBundleCoverage coverage = (IBundleCoverage) modelCoverage
.getCoverageFor(root);
if (coverage != null) {
projectgroup.visitBundle(coverage, createSourceFileLocator(root));
monitor.worked(1);
}