use of org.erlide.cover.ui.views.util.BrowserDialog in project erlide_eclipse by erlang.
the class HtmlReportAction method run.
@Override
public void run() {
log.info("html report!");
if (StatsTreeModel.getInstance().getRoot().getHtmlPath() == null) {
final IPath location = Activator.getDefault().getStateLocation().append(CoverConstants.REPORT_DIR);
final File dir = location.toFile();
if (!dir.exists() && !dir.mkdir()) {
CoverageHelper.reportError("Can not save results!");
return;
}
generateReportTree(StatsTreeModel.getInstance().getRoot(), dir.getAbsolutePath());
}
final ISelection selection = viewer.getSelection();
log.info(selection.getClass().getName());
if (!(selection instanceof ITreeSelection)) {
final IStatus executionStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Internall error occured: bad sellection type", null);
StatusManager.getManager().handle(executionStatus, StatusManager.SHOW);
return;
}
final ITreeSelection treeSelection = (ITreeSelection) selection;
log.info(treeSelection.getFirstElement());
log.info(treeSelection.getFirstElement().getClass().getName());
log.info(treeSelection.getPaths());
final StatsTreeObject selObj = (StatsTreeObject) treeSelection.getFirstElement();
final BrowserDialog browser = new BrowserDialog(shell);
if (selObj instanceof FunctionStats) {
final ModuleStats module = (ModuleStats) selObj.getParent();
browser.setObject(module);
} else {
browser.setObject(selObj);
}
browser.open();
}
Aggregations