use of name.abuchen.portfolio.datatransfer.csv.AktienfreundeNetExporter in project portfolio by buchen.
the class ExportWizard method performFinish.
@Override
public boolean performFinish() {
Object exportItem = exportPage.getExportItem();
Class<?> exportClass = exportPage.getExportClass();
File file = getFile(exportItem);
if (file == null)
return false;
try {
// account transactions
if (exportItem == AccountTransaction.class) {
new CSVExporter().exportAccountTransactions(file, client.getAccounts());
} else if (exportClass == AccountTransaction.class) {
new CSVExporter().exportAccountTransactions(file, (Account) exportItem);
} else // portfolio transactions
if (exportItem == PortfolioTransaction.class) {
new CSVExporter().exportPortfolioTransactions(file, client.getPortfolios());
} else if (exportClass == PortfolioTransaction.class) {
new CSVExporter().exportPortfolioTransactions(file, (Portfolio) exportItem);
} else // master data
if (exportItem == Security.class) {
new CSVExporter().exportSecurityMasterData(new File(file, Messages.ExportWizardSecurityMasterData + ".csv"), // $NON-NLS-1$
client.getSecurities());
} else if (exportClass == Security.class) {
if (Messages.ExportWizardSecurityMasterData.equals(exportItem))
new CSVExporter().exportSecurityMasterData(file, client.getSecurities());
else if (Messages.ExportWizardMergedSecurityPrices.equals(exportItem))
new CSVExporter().exportMergedSecurityPrices(file, client.getSecurities());
else if (Messages.ExportWizardAllTransactionsAktienfreundeNet.equals(exportItem))
new AktienfreundeNetExporter().exportAllTransactions(file, client);
} else // historical quotes
if (exportItem == SecurityPrice.class) {
new CSVExporter().exportSecurityPrices(file, client.getSecurities());
} else if (exportClass == SecurityPrice.class) {
new CSVExporter().exportSecurityPrices(file, (Security) exportItem);
} else {
throw new UnsupportedOperationException(MessageFormat.format(Messages.ExportWizardUnsupportedExport, exportClass, exportItem));
}
} catch (IOException e) {
PortfolioPlugin.log(e);
MessageDialog.openError(getShell(), Messages.ExportWizardErrorExporting, e.getMessage());
}
return true;
}
Aggregations