use of name.abuchen.portfolio.ui.util.LabelOnly in project portfolio by buchen.
the class StatementOfAssetsViewer method menuAboutToShow.
private // NOSONAR
void menuAboutToShow(// NOSONAR
IMenuManager manager) {
manager.add(new LabelOnly(Messages.LabelTaxonomies));
for (final Taxonomy t : client.getTaxonomies()) {
Action action = new Action(t.getName()) {
@Override
public void run() {
taxonomy = t;
if (clientSnapshot != null)
internalSetInput(clientSnapshot.groupByTaxonomy(taxonomy));
else
internalSetInput(portfolioSnapshot.groupByTaxonomy(taxonomy));
}
};
action.setChecked(t.equals(taxonomy));
manager.add(action);
}
manager.add(new Separator());
manager.add(new LabelOnly(Messages.LabelColumns));
support.menuAboutToShow(manager);
}
use of name.abuchen.portfolio.ui.util.LabelOnly in project portfolio by buchen.
the class BookmarksListTab method addSubmenuWithPlaceholders.
private void addSubmenuWithPlaceholders(IMenuManager manager) {
MenuManager submenu = new MenuManager(Messages.BookmarksListView_replacements);
manager.add(submenu);
@SuppressWarnings("nls") List<String> defaultReplacements = Arrays.asList(new String[] { "isin", "name", "wkn", "tickerSymbol", "tickerSymbolPrefix" });
submenu.add(new LabelOnly(Messages.BookmarksListView_LabelDefaultReplacements));
defaultReplacements.forEach(r -> addReplacementMenu(submenu, r));
submenu.add(new Separator());
submenu.add(new LabelOnly(Messages.BookmarksListView_LabelAttributeReplacements));
client.getSettings().getAttributeTypes().filter(a -> a.supports(Security.class)).filter(a -> !defaultReplacements.contains(a.getColumnLabel())).forEach(a -> addReplacementMenu(submenu, a.getColumnLabel()));
submenu.add(new Separator());
submenu.add(new LabelOnly(Messages.BookmarksListView_LabelReplaceFirstAvailable));
// $NON-NLS-1$
addReplacementMenu(submenu, "isin,wkn");
}
use of name.abuchen.portfolio.ui.util.LabelOnly in project portfolio by buchen.
the class AttributesPage method menuAboutToShow.
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(new LabelOnly(Messages.LabelAvailableAttributes));
Set<AttributeType> existing = new HashSet<AttributeType>();
for (AttributeDesignation d : model.getAttributes()) existing.add(d.getType());
//
model.getClient().getSettings().getAttributeTypes().filter(//
a -> !existing.contains(a)).filter(//
a -> a.supports(Security.class)).forEach(attribute -> addMenu(manager, attribute));
}
use of name.abuchen.portfolio.ui.util.LabelOnly in project portfolio by buchen.
the class AccountTransactionDialog method sharesMenuAboutToShow.
private // NOSONAR
void sharesMenuAboutToShow(// NOSONAR
IMenuManager manager) {
manager.add(new LabelOnly(Messages.DividendsDialogTitleShares));
CurrencyConverter converter = new CurrencyConverterImpl(model.getExchangeRateProviderFactory(), client.getBaseCurrency());
ClientSnapshot snapshot = ClientSnapshot.create(client, converter, model().getDate());
if (snapshot != null && model().getSecurity() != null) {
PortfolioSnapshot jointPortfolio = snapshot.getJointPortfolio();
addAction(manager, jointPortfolio, Messages.ColumnSharesOwned);
List<PortfolioSnapshot> list = snapshot.getPortfolios();
if (list.size() > 1) {
for (PortfolioSnapshot ps : list) addAction(manager, ps, ps.getPortfolio().getName());
}
}
manager.add(new Action(Messages.DividendsDialogLabelSpecialDistribution) {
@Override
public void run() {
model().setShares(0);
}
});
}
use of name.abuchen.portfolio.ui.util.LabelOnly in project portfolio by buchen.
the class ClientEditorSidebar method taxonomyCreateMenuAboutToShow.
private void taxonomyCreateMenuAboutToShow(IMenuManager manager) {
manager.add(new Action(Messages.MenuTaxonomyCreate) {
@Override
public void run() {
String name = askTaxonomyName(Messages.LabelNewTaxonomy);
if (name == null)
return;
Taxonomy taxonomy = new Taxonomy(name);
taxonomy.setRootNode(new Classification(UUID.randomUUID().toString(), name));
addAndOpenTaxonomy(taxonomy);
}
});
manager.add(new Separator());
manager.add(new LabelOnly(Messages.LabelTaxonomyTemplates));
for (final TaxonomyTemplate template : TaxonomyTemplate.list()) {
manager.add(new Action(template.getName()) {
@Override
public void run() {
addAndOpenTaxonomy(template.build());
}
});
}
}
Aggregations