use of org.eclipse.linuxtools.dataviewers.actions.STExportToCSVAction in project linuxtools by eclipse.
the class GcovTest method testGcovSummary.
private void testGcovSummary(final String filename, String binPath, final boolean testProducedReference) {
openGcovResult(project.getFile(filename), binPath, true);
IViewPart vp = window.getActivePage().findView("org.eclipse.linuxtools.gcov.view");
// No IDs on toolbar items, so explicitly check each one for tooltip texts
List<String> sortTypes = new ArrayList<>(Arrays.asList("function", "file", "folder"));
IContributionItem[] items = vp.getViewSite().getActionBars().getToolBarManager().getItems();
STExportToCSVAction csvAction = null;
for (IContributionItem item : items) {
if (item instanceof ActionContributionItem && ((ActionContributionItem) item).getAction() instanceof STExportToCSVAction) {
csvAction = (STExportToCSVAction) ((ActionContributionItem) item).getAction();
}
}
Assert.assertNotNull("CSV-Export toolbar button does not exist.", csvAction);
for (IContributionItem item : items) {
if (item instanceof ActionContributionItem) {
final IAction action = ((ActionContributionItem) item).getAction();
for (int i = 0, n = sortTypes.size(); i < n; i++) {
String sortType = sortTypes.get(i);
if (action.getText().equals("Sort coverage per " + sortType)) {
dumpCSV(action, csvAction, sortType, testProducedReference);
if (sortTypes.size() == 1) {
return;
}
sortTypes.remove(i);
break;
}
}
}
}
}
use of org.eclipse.linuxtools.dataviewers.actions.STExportToCSVAction in project linuxtools by eclipse.
the class GmonView method createExportToCSVAction.
@Override
protected IAction createExportToCSVAction() {
IAction action = new STExportToCSVAction(this.getSTViewer()) {
@Override
public void run() {
Object o = getSTViewer().getInput();
if (o instanceof GmonDecoder) {
GmonDecoder gd = (GmonDecoder) o;
// $NON-NLS-1$
getExporter().setFilePath(gd.getGmonFile() + ".csv");
}
super.run();
}
};
return action;
}
use of org.eclipse.linuxtools.dataviewers.actions.STExportToCSVAction in project linuxtools by eclipse.
the class CovView method createExportToCSVAction.
@Override
protected IAction createExportToCSVAction() {
IAction action = new STExportToCSVAction(this.getSTViewer()) {
@Override
public void run() {
Object o = getSTViewer().getInput();
if (o instanceof CovManager) {
getExporter().setFilePath(defaultCSVPath);
}
super.run();
}
};
return action;
}
Aggregations