/*
 * Minecraft Dev for IntelliJ
 *
 * https://minecraftdev.org
 *
 * Copyright (c) 2016 minecraft-dev
 *
 * MIT License
 */

package com.demonwav.mcdev.update;

import com.google.common.collect.ImmutableList;
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public enum Channels {
    SCOTLIN("Kotlin And Scala Support", "https://plugins.jetbrains.com/plugins/kotlin%20and%20scala%20support/8327", 1);

    private final String title;
    private final String url;
    private final int index;

    Channels(final String title, final String url, final int index) {
        this.title = title;
        this.url = url;
        this.index = index;
    }

    public String getTitle() {
        return title;
    }

    public String getUrl() {
        return url;
    }

    public int getIndex() {
        return index;
    }

    @Nullable
    public static Channels getChannel(int index) {
        for (Channels channels : values()) {
            if (channels.getIndex() == index) {
                return channels;
            }
        }

        return null;
    }

    public static List<Channels> orderedList() {
        return ImmutableList.of(SCOTLIN);
    }

    public boolean hasChannel() {
        return UpdateSettings.getInstance().getPluginHosts().contains(url);
    }
}

@@ -366,123 +366,8 @@
     
-SCOTLIN(%22Kotlin And Scala Support%22, %22https://plugins.jetbrains.com/plugins/kotlin%2520and%2520scala%2520support/8327%22, 1)
 ;%0A%0A 
@@ -1116,15 +1116,8 @@
 .of(
-SCOTLIN
 );%0A 

Remove Kotlin and Scala support channel, as it's diverged too far