column.setSorter(null);
support.addColumn(column);
column = new Column("10", Messages.ColumnIRRPerformance, SWT.RIGHT, 80); //$NON-NLS-1$
column.setOptions(Messages.LabelReportingYears, Messages.ColumnIRRPerformanceOption, 1, 2, 3, 4, 5, 10);
column.setLabelProvider(new OptionLabelProvider()
{
@Override
public String getText(Object e, Integer option)
{
Element element = (Element) e;
if (element.isSecurity())
{
calculatePerformance(element, option);
SecurityPerformanceRecord record = element.getPerformance(option);
return Values.Percent.format(record.getIrr());
}
return null;
}
@Override
public Color getForeground(Object e, Integer option)
{
Element element = (Element) e;
if (element.isSecurity())
{
calculatePerformance(element, option);
SecurityPerformanceRecord record = element.getPerformance(option);
double irr = record.getIrr();
if (irr < 0)
return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED);
else if (irr > 0)
return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN);
}
return null;
}
});
column.setVisible(false);
support.addColumn(column);
column = new Column("11", Messages.ColumnTotalProfitLoss, SWT.RIGHT, 80); //$NON-NLS-1$
column.setOptions(Messages.LabelReportingYears, Messages.ColumnTotalProfitLossOption, 1, 2, 3, 4, 5, 10);
column.setLabelProvider(new OptionLabelProvider()
{
@Override
public String getText(Object e, Integer option)
{
Element element = (Element) e;