use of com.intellij.coverage.CoverageEngine 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.coverage.CoverageEngine in project intellij-community by JetBrains.
the class GenerateCoverageReportAction method update.
public void update(final AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Presentation presentation = e.getPresentation();
presentation.setEnabled(false);
presentation.setVisible(false);
final Project project = e.getProject();
if (project != null) {
final CoverageSuitesBundle currentSuite = CoverageDataManager.getInstance(project).getCurrentSuitesBundle();
if (currentSuite != null) {
final CoverageEngine coverageEngine = currentSuite.getCoverageEngine();
if (coverageEngine.isReportGenerationAvailable(project, dataContext, currentSuite)) {
presentation.setEnabled(true);
presentation.setVisible(true);
}
}
}
}
use of com.intellij.coverage.CoverageEngine in project intellij-community by JetBrains.
the class PercentageCoverageColumnInfo method valueOf.
@Override
public String valueOf(NodeDescriptor node) {
final CoverageEngine coverageEngine = mySuitesBundle.getCoverageEngine();
final Project project = node.getProject();
return coverageEngine.createCoverageViewExtension(project, mySuitesBundle, myStateBean).getPercentage(myColumnIdx, (AbstractTreeNode) node);
}
use of com.intellij.coverage.CoverageEngine in project intellij-community by JetBrains.
the class CoverageEnabledConfiguration method getOrCreate.
@NotNull
public static CoverageEnabledConfiguration getOrCreate(@NotNull final RunConfigurationBase runConfiguration) {
CoverageEnabledConfiguration configuration = runConfiguration.getCopyableUserData(COVERAGE_KEY);
if (configuration == null) {
for (CoverageEngine engine : CoverageEngine.EP_NAME.getExtensions()) {
if (engine.isApplicableTo(runConfiguration)) {
configuration = engine.createCoverageEnabledConfiguration(runConfiguration);
break;
}
}
LOG.assertTrue(configuration != null, "Coverage enabled run configuration wasn't found for run configuration: " + runConfiguration.getName() + ", type = " + runConfiguration.getClass().getName());
runConfiguration.putCopyableUserData(COVERAGE_KEY, configuration);
}
return configuration;
}
Aggregations