@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
if (value instanceof ProjectTemplate) {
ProjectTemplate template = (ProjectTemplate) value;
String display = template.getName();
Component comp = super.getListCellRendererComponent(list, display, index, isSelected, cellHasFocus);
if (comp instanceof JComponent) {
((JComponent) comp).setToolTipText(template.getDescription());
}
return comp;
}
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
}