}
private void addAction(IMenuManager manager, PortfolioSnapshot portfolio, final String label)
{
Model model = (Model) getModel();
final SecurityPosition position = portfolio.getPositionsBySecurity().get(model.getSecurity());
if (position != null)
{
Action action = new Action(MessageFormat.format(Messages.DividendsDialogLabelPortfolioSharesHeld,
Values.Share.format(position.getShares()), label, portfolio.getTime()))
{
@Override
public void run()
{
((Model) getModel()).setShares(position.getShares());
}
};
manager.add(action);
}
}