use of org.eclipse.titanium.metrics.MetricGroup in project titan.EclipsePlug-ins by eclipse.
the class CNComparator method write.
public void write(final RiskLevel r) {
try {
final HSSFWorkbook workbook = new HSSFWorkbook();
for (final MetricGroup type : new MetricGroup[] { MetricGroup.MODULE, MetricGroup.ALTSTEP, MetricGroup.FUNCTION, MetricGroup.TESTCASE }) {
for (final IMetricEnum metric : type.getMetrics()) {
if (!(PreferenceManager.isEnabledOnView(metric))) {
continue;
}
final ProjectStatNode pn = new ProjectStatNode(metric);
if (!pn.hasChildren(data) || pn.getRiskLevel(data).compareTo(r) < 0) {
continue;
}
final Sheet sheet = workbook.createSheet(getSheetName(metric));
printChildren(sheet, pn, 0, 0);
}
}
final FileOutputStream fileOutputStream = new FileOutputStream(file);
workbook.write(fileOutputStream);
IOUtils.closeQuietly(fileOutputStream);
} catch (IOException e) {
ErrorReporter.logExceptionStackTrace("Error while exporting to excel", e);
}
}
Aggregations