}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
Repository repository = (Repository) value;
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
if (repository == null) {
nameLabel.setText("");
idLabel.setText("");
descriptionLabel.setText("");
} else {
nameLabel.setText(repository.getName());
idLabel.setText(repository.getId());
descriptionLabel.setText(repository.getDescription());
}
return this;
}