// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/holders/TmcSettingsManager.java
// public final class TmcSettingsManager {
// 
//     private static final Logger logger = LoggerFactory.getLogger(TmcSettingsManager.class);
//     private static final PersistentTmcSettings persistentSettings =
//             ServiceManager.getService(PersistentTmcSettings.class);
// 
//     private TmcSettingsManager() {}
// 
//     public static synchronized SettingsTmc get() {
//         logger.info("Get SettingsTmc. @TmcSettingsManager.");
//         if (persistentSettings.getSettingsTmc() == null) {
//             persistentSettings.setSettingsTmc(new SettingsTmc());
//         }
//         return persistentSettings.getSettingsTmc();
//     }
// 
//     public static synchronized void setup() {
//         logger.info("Setup SettingsTmc. @TmcSettingsManager.");
//         if (persistentSettings.getSettingsTmc() == null) {
//             persistentSettings.setSettingsTmc(new SettingsTmc());
//         }
//     }
// }


import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBList;
import com.intellij.ui.components.JBScrollPane;
import fi.helsinki.cs.tmc.core.domain.Organization;
import fi.helsinki.cs.tmc.intellij.holders.TmcSettingsManager;
import javax.swing.*;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;
            information = information.substring(0, 187) + "...";
        }
        this.organizationInformation.setText(information);
        this.organizationSlug.setText("/" + organization.getSlug());

        setLogo();
    }

    private void setLogo() {
        setLogo(logoUrl("placeholderLogo.png"));
        final String logoPath = organization.getLogoPath();
        if(!logoPath.contains("missing")) {
            new Thread(() -> {
                setLogo(logoUrl(logoPath));
                this.parent.repaint();
            }).start();
        }
    }

    private void setLogo(URL logoUrl) {
        this.image = new ImageIcon(logoUrl);
        this.image.setImage(this.image.getImage().getScaledInstance(49, 49, Image.SCALE_SMOOTH));
        this.logo.setIcon(this.image);
    }

    public Organization getOrganization() {
        return this.organization;
    }

    private URL logoUrl(String path) {
// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/holders/TmcSettingsManager.java
// public final class TmcSettingsManager {
// 
//     private static final Logger logger = LoggerFactory.getLogger(TmcSettingsManager.class);
//     private static final PersistentTmcSettings persistentSettings =
//             ServiceManager.getService(PersistentTmcSettings.class);
// 
//     private TmcSettingsManager() {}
// 
//     public static synchronized SettingsTmc get() {
//         logger.info("Get SettingsTmc. @TmcSettingsManager.");
//         if (persistentSettings.getSettingsTmc() == null) {
//             persistentSettings.setSettingsTmc(new SettingsTmc());
//         }
//         return persistentSettings.getSettingsTmc();
//     }
// 
//     public static synchronized void setup() {
//         logger.info("Setup SettingsTmc. @TmcSettingsManager.");
//         if (persistentSettings.getSettingsTmc() == null) {
//             persistentSettings.setSettingsTmc(new SettingsTmc());
//         }
//     }
// }


// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/ui/organizationselection/OrganizationCard.java
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBList;
import com.intellij.ui.components.JBScrollPane;
import fi.helsinki.cs.tmc.core.domain.Organization;
import fi.helsinki.cs.tmc.intellij.holders.TmcSettingsManager;
import javax.swing.*;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;

            information = information.substring(0, 187) + "...";
        }
        this.organizationInformation.setText(information);
        this.organizationSlug.setText("/" + organization.getSlug());

        setLogo();
    }

    private void setLogo() {
        setLogo(logoUrl("placeholderLogo.png"));
        final String logoPath = organization.getLogoPath();
        if(!logoPath.contains("missing")) {
            new Thread(() -> {
                setLogo(logoUrl(logoPath));
                this.parent.repaint();
            }).start();
        }
    }

    private void setLogo(URL logoUrl) {
        this.image = new ImageIcon(logoUrl);
        this.image.setImage(this.image.getImage().getScaledInstance(49, 49, Image.SCALE_SMOOTH));
        this.logo.setIcon(this.image);
    }

    public Organization getOrganization() {
        return this.organization;
    }

    private URL logoUrl(String path) {
        final String address = TmcSettingsManager.get().getServerAddress();