if (object == null) // ebbene si, puo' capitare anche questo!
{
return null;
}
MultiNamedFile file = (MultiNamedFile) object;
JComponent component;
Collection<String> names = file.getNames();
if (names.size() > 1)
{
JComboBox comboBox = new JComboBox();
for (String name : names)
{
comboBox.addItem(name);
}
component = comboBox;
}
else
{
component = new JLabel(file.getFirstName());
}
component.setOpaque(true);
return component;