use of com.intellij.codeInspection.export.ExportToHTMLDialog in project intellij-community by JetBrains.
the class GenerateCoverageReportAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = e.getProject();
assert project != null;
final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
final CoverageSuitesBundle currentSuite = coverageDataManager.getCurrentSuitesBundle();
final CoverageEngine coverageEngine = currentSuite.getCoverageEngine();
final ExportToHTMLDialog dialog = coverageEngine.createGenerateReportDialog(project, dataContext, currentSuite);
dialog.reset();
if (!dialog.showAndGet()) {
return;
}
dialog.apply();
coverageEngine.generateReport(project, dataContext, currentSuite);
}
use of com.intellij.codeInspection.export.ExportToHTMLDialog in project intellij-community by JetBrains.
the class ExportHTMLAction method exportHTML.
private void exportHTML(final boolean exportToHTML) {
ExportToHTMLDialog exportToHTMLDialog = new ExportToHTMLDialog(myView.getProject(), exportToHTML);
final ExportToHTMLSettings exportToHTMLSettings = ExportToHTMLSettings.getInstance(myView.getProject());
if (exportToHTMLSettings.OUTPUT_DIRECTORY == null) {
exportToHTMLSettings.OUTPUT_DIRECTORY = PathManager.getHomePath() + File.separator + "inspections";
}
exportToHTMLDialog.reset();
if (!exportToHTMLDialog.showAndGet()) {
return;
}
exportToHTMLDialog.apply();
final String outputDirectoryName = exportToHTMLSettings.OUTPUT_DIRECTORY;
ApplicationManager.getApplication().invokeLater(() -> {
final Runnable exportRunnable = () -> ApplicationManager.getApplication().runReadAction(() -> {
if (!exportToHTML) {
dump2xml(outputDirectoryName);
} else {
try {
new InspectionTreeHtmlWriter(myView, outputDirectoryName);
} catch (ProcessCanceledException e) {
// Do nothing here.
}
}
});
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(exportRunnable, InspectionsBundle.message(exportToHTML ? "inspection.generating.html.progress.title" : "inspection.generating.xml.progress.title"), true, myView.getProject())) {
return;
}
if (exportToHTML && exportToHTMLSettings.OPEN_IN_BROWSER) {
BrowserUtil.browse(new File(exportToHTMLSettings.OUTPUT_DIRECTORY, "index.html"));
}
});
}
use of com.intellij.codeInspection.export.ExportToHTMLDialog in project intellij-community by JetBrains.
the class CoverageEngine method createGenerateReportDialog.
@NotNull
public ExportToHTMLDialog createGenerateReportDialog(@NotNull final Project project, @NotNull final DataContext dataContext, @NotNull final CoverageSuitesBundle currentSuite) {
final ExportToHTMLDialog dialog = new ExportToHTMLDialog(project, true);
dialog.setTitle("Generate Coverage Report for: \'" + currentSuite.getPresentableName() + "\'");
return dialog;
}
Aggregations