use of name.abuchen.portfolio.ui.util.SimpleAction in project portfolio by buchen.
the class DividendsView method addButtons.
@Override
protected void addButtons(ToolBar toolBar) {
new StartYearSelectionDropDown(toolBar, model);
AbstractDropDown dropDown = AbstractDropDown.create(toolBar, Messages.MenuChooseClientFilter, model.getClientFilterMenu().hasActiveFilter() ? Images.FILTER_ON.image() : Images.FILTER_OFF.image(), SWT.NONE, model.getClientFilterMenu()::menuAboutToShow);
model.getClientFilterMenu().addListener(f -> dropDown.getToolItem().setImage(model.getClientFilterMenu().hasActiveFilter() ? Images.FILTER_ON.image() : Images.FILTER_OFF.image()));
new AbstractDropDown(toolBar, Messages.MenuExportData, Images.EXPORT.image(), SWT.NONE) {
@Override
public void menuAboutToShow(IMenuManager manager) {
final int itemCount = folder.getItemCount();
for (int ii = 0; ii < itemCount; ii++) {
DividendsTab tab = (DividendsTab) folder.getItem(ii).getData();
if (tab != null)
tab.addExportActions(manager);
}
}
};
new AbstractDropDown(toolBar, Messages.MenuConfigureChart, Images.CONFIG.image(), SWT.NONE) {
@Override
public void menuAboutToShow(IMenuManager manager) {
Action action = new SimpleAction(Messages.LabelUseGrossDividends, a -> model.setUseGrossValue(!model.usesGrossValue()));
action.setChecked(model.usesGrossValue());
manager.add(action);
DividendsTab tab = (DividendsTab) folder.getSelection().getData();
if (tab != null) {
manager.add(new Separator());
tab.addConfigActions(manager);
}
}
};
}
Aggregations