use of name.abuchen.portfolio.ui.util.AbstractDropDown in project portfolio by buchen.
the class InvestmentPlanListView method addConfigButton.
private void addConfigButton(final ToolBar toolBar) {
new AbstractDropDown(toolBar, Messages.MenuShowHideColumns, Images.CONFIG.image(), SWT.NONE) {
@Override
public void menuAboutToShow(IMenuManager manager) {
MenuManager m = new MenuManager(Messages.LabelInvestmentPlans);
planColumns.menuAboutToShow(m);
manager.add(m);
m = new MenuManager(Messages.LabelTransactions);
transactions.getColumnSupport().menuAboutToShow(m);
manager.add(m);
}
};
}
use of name.abuchen.portfolio.ui.util.AbstractDropDown in project portfolio by buchen.
the class AccountListView method addConfigButton.
private void addConfigButton(final ToolBar toolBar) {
new // NOSONAR
AbstractDropDown(// NOSONAR
toolBar, // NOSONAR
Messages.MenuShowHideColumns, // NOSONAR
Images.CONFIG.image(), // NOSONAR
SWT.NONE) {
@Override
public void menuAboutToShow(IMenuManager manager) {
MenuManager m = new MenuManager(Messages.LabelAccounts);
accountColumns.menuAboutToShow(m);
manager.add(m);
m = new MenuManager(Messages.LabelTransactions);
transactionsColumns.menuAboutToShow(m);
manager.add(m);
}
};
}
use of name.abuchen.portfolio.ui.util.AbstractDropDown in project portfolio by buchen.
the class PortfolioListView method addConfigButton.
private void addConfigButton(final ToolBar toolBar) {
new AbstractDropDown(toolBar, Messages.MenuShowHideColumns, Images.CONFIG.image(), SWT.NONE) {
@Override
public void menuAboutToShow(IMenuManager manager) {
MenuManager m = new MenuManager(Messages.LabelPortfolios);
portfolioColumns.menuAboutToShow(m);
manager.add(m);
m = new MenuManager(Messages.LabelTransactions);
transactions.getColumnSupport().menuAboutToShow(m);
manager.add(m);
}
};
}
use of name.abuchen.portfolio.ui.util.AbstractDropDown 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);
}
use of name.abuchen.portfolio.ui.util.AbstractDropDown 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