use of name.abuchen.portfolio.ui.util.TableViewerCSVExporter in project portfolio by buchen.
the class SecuritiesPerformanceView method addExportButton.
private void addExportButton(ToolBar toolBar) {
Action export = new Action() {
@Override
public void run() {
// $NON-NLS-1$
new TableViewerCSVExporter(records).export(getTitle() + ".csv");
}
};
export.setImageDescriptor(Images.EXPORT.descriptor());
export.setToolTipText(Messages.MenuExportData);
new ActionContributionItem(export).fill(toolBar, -1);
}
use of name.abuchen.portfolio.ui.util.TableViewerCSVExporter in project portfolio by buchen.
the class SecurityListView method addExportButton.
private void addExportButton(ToolBar toolBar) {
Action export = new Action() {
@Override
public void run() {
//
new TableViewerCSVExporter(securities.getTableViewer()).export(// $NON-NLS-1$
getTitle() + ".csv");
}
};
export.setImageDescriptor(Images.EXPORT.descriptor());
export.setToolTipText(Messages.MenuExportData);
new ActionContributionItem(export).fill(toolBar, -1);
}
use of name.abuchen.portfolio.ui.util.TableViewerCSVExporter in project portfolio by buchen.
the class StatementOfAssetsView method addButtons.
@Override
protected void addButtons(final ToolBar toolBar) {
AbstractDropDown dropdown = new AbstractDropDown(toolBar, getClient().getBaseCurrency()) {
@Override
public void menuAboutToShow(IMenuManager manager) {
List<CurrencyUnit> available = CurrencyUnit.getAvailableCurrencyUnits();
Collections.sort(available);
for (final CurrencyUnit unit : available) {
Action action = new SimpleAction(unit.getLabel(), a -> {
setLabel(unit.getCurrencyCode());
getClient().setBaseCurrency(unit.getCurrencyCode());
});
action.setChecked(getClient().getBaseCurrency().equals(unit.getCurrencyCode()));
manager.add(action);
}
}
};
currencyChangeListener = e -> dropdown.setLabel(e.getNewValue().toString());
// $NON-NLS-1$
getClient().addPropertyChangeListener("baseCurrency", currencyChangeListener);
addCalendarButton(toolBar);
this.clientFilter = new ClientFilterDropDown(toolBar, getClient(), getPreferenceStore(), StatementOfAssetsView.class.getSimpleName(), filter -> notifyModelUpdated());
Action export = new SimpleAction(null, action -> new TableViewerCSVExporter(assetViewer.getTableViewer()).export(// $NON-NLS-1$
Messages.LabelStatementOfAssets + ".csv"));
export.setImageDescriptor(Images.EXPORT.descriptor());
export.setToolTipText(Messages.MenuExportData);
new ActionContributionItem(export).fill(toolBar, -1);
Action save = new SimpleAction(null, a -> assetViewer.showSaveMenu(getActiveShell()));
save.setImageDescriptor(Images.SAVE.descriptor());
save.setToolTipText(Messages.MenuSaveColumns);
new ActionContributionItem(save).fill(toolBar, -1);
Action config = new SimpleAction(null, a -> assetViewer.showConfigMenu(toolBar.getShell()));
config.setImageDescriptor(Images.CONFIG.descriptor());
config.setToolTipText(Messages.MenuShowHideColumns);
new ActionContributionItem(config).fill(toolBar, -1);
}
Aggregations