public class ConnectionConfigListCellRenderer extends DefaultListCellRenderer{
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
ConnectionSettings connectionSettings = (ConnectionSettings) value;
ConnectionDatabaseSettings databaseSettings = connectionSettings.getDatabaseSettings();
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus );
GenericDatabaseSettingsForm settingsEditor = databaseSettings.getSettingsEditor();
String name = settingsEditor == null ?
databaseSettings.getName() :
settingsEditor.getConnectionName();
ConnectivityStatus connectivityStatus = settingsEditor == null ?
databaseSettings.getConnectivityStatus() :
settingsEditor.getConnectivityStatus();
boolean isActive = settingsEditor == null ?
databaseSettings.isActive() :
settingsEditor.isConnectionActive();
Icon icon = Icons.CONNECTION_DISABLED;
boolean isNew = connectionSettings.getDatabaseSettings().isNew();
if (isNew) {