final boolean cellHasFocus)
{
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FieldDefinition)
{
final FieldDefinition fd = (FieldDefinition) value;
// format a display string
final StringBuilder sb = new StringBuilder(50);
// Add name
sb.append(fd.getDisplayName());
sb.append(" ("); // NON-NLS
// Add Display name if it's not the same as Name
if (fd.getName().equals(fd.getDisplayName()) == false)
{
sb.append(fd.getName()).append(", "); // NON-NLS
}
// Add Type
sb.append(fd.getFieldType().getName());
//noinspection MagicCharacter
sb.append(')');
setText(sb.toString());
setIcon(fd.getIcon());
}
else
{
setIcon(null);
setText(" ");