package _VisualDVM.ProjectData;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;

import java.util.Arrays;
import java.util.Vector;
public enum LanguageName {
    n,
    fortran,
    c,
    cpp;
    public String getDescription() {
        switch (this) {
            case fortran:
                return "Fortran";
            case c:
                return "С";
            case cpp:
                return "С++";
            case n:
                return "нет";
        }
        return "";
    }
    public String getDVMLink() {
        switch (this) {
            case fortran:
                return "f";
            //"flink";
            case c:
                return "c";
            //"clink";
            default:
                return "";
        }
    }
    public String getDVMCompile() {
        switch (this) {
            case fortran:
                return "f";
            case c:
                return "c";
            default:
                return "";
        }
    }
    public String getStyleKey() {
        switch (this) {
            case fortran:
                return //SyntaxConstants.SYNTAX_STYLE_FORTRAN;
                        "text/FortranSPF";
            case c:
                return SyntaxConstants.SYNTAX_STYLE_C;
            case cpp:
                return SyntaxConstants.SYNTAX_STYLE_CPLUSPLUS;
            default:
                return SyntaxConstants.SYNTAX_STYLE_NONE;
        }
    }
    public String getIcon() {
        switch (this) {
            case fortran:
                return "/icons/Languages/Fortran.png";
            case c:
                return "/icons/Languages/C.png";
            case cpp:
                return "/icons/Languages/Cpp.png";
            default:
                return "";
        }
    }
    public Vector<String> getExtensions() {
        String[] res;
        switch (this) {
            case fortran:
                res = new String[]{"f", "fdv", "for", "f77", "f90", "h"};
                break;
            case c:
                res = new String[]{"c", "cdv", "h"};
                break;
            case cpp:
                res = new String[]{"cpp", "h"};
                break;
            default:
                res = new String[]{};
                break;
        }
        return new Vector<>(Arrays.asList(res));
    }
    public String PrintExtensions() {
        return String.join(",", getExtensions());
    }
}
