manager.add(new Action(MessageFormat.format(Messages.LabelExport, label))
{
@Override
public void run()
{
AbstractCSVExporter exporter = new AbstractCSVExporter()
{
@Override
protected void writeToFile(File file) throws IOException
{
PerformanceIndex index = (PerformanceIndex) dataCache.get(instance);
if (aggregationPeriod != null)
index = Aggregation.aggregate(index, aggregationPeriod);
index.exportTo(file);
}
@Override
protected Control getControl()
{
return ExportDropDown.this.getToolBar();
}
};
exporter.export(getTitle() + "_" + label + ".csv"); //$NON-NLS-1$ //$NON-NLS-2$
}
});
}