use of name.abuchen.portfolio.ui.util.ClientFilterDropDown in project portfolio by buchen.
the class PerformanceView method addButtons.
@Override
protected void addButtons(ToolBar toolBar) {
super.addButtons(toolBar);
this.clientFilter = new ClientFilterDropDown(toolBar, getClient(), getPreferenceStore(), PerformanceView.class.getSimpleName(), filter -> notifyModelUpdated());
// NOSONAR
new ExportDropDown(toolBar);
}
use of name.abuchen.portfolio.ui.util.ClientFilterDropDown 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