manager.add(new Action(Messages.ConsumerPriceIndexMenuDelete)
{
@Override
public void run()
{
ConsumerPriceIndex index = (ConsumerPriceIndex) ((IStructuredSelection) indices.getSelection())
.getFirstElement();
if (index == null)
return;
getClient().removeConsumerPriceIndex(index);
markDirty();
indices.setInput(getClient().getConsumerPriceIndices());
refreshChart();
}
});
manager.add(new Action(Messages.ConsumerPriceIndexMenuAdd)
{
@Override
public void run()
{
ConsumerPriceIndex index = new ConsumerPriceIndex();
index.setYear(Calendar.getInstance().get(Calendar.YEAR));
index.setMonth(Calendar.getInstance().get(Calendar.MONTH));
getClient().addConsumerPriceIndex(index);
markDirty();
indices.setInput(getClient().getConsumerPriceIndices());