package com.mglaman.drupal_run_tests.run.tests;

import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.jetbrains.php.run.PhpRunConfigurationFactoryBase;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

/**
 * @author mglaman
 */
public class DrupalRunConfigurationType implements ConfigurationType {
    private static final String DISPLAY_NAME = "Drupal Run Tests";
    private static final String DESCRIPTION = "Runs Drupal Simpletest and PHPUnit.";

    private final ConfigurationFactory myFactory = new PhpRunConfigurationFactoryBase(this) {
        @Override
        @NotNull
        public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
            return new DrupalRunConfiguration(project, this);
        }
    };

    @Override
    public String getDisplayName() {
        return DISPLAY_NAME;
    }

    @Override
    public String getConfigurationTypeDescription() {
        return DESCRIPTION;
    }

    @Override
    public Icon getIcon() {
        return IconLoader.getIcon("/druplicon-small.png");
    }

    @NotNull
    @Override
    public String getId() {
        return "DrupalRunTestsConfigurationType";
    }

    @Override
    public ConfigurationFactory[] getConfigurationFactories() {
        return new ConfigurationFactory[]{this.myFactory};
    }
}

@@ -387,16 +387,42 @@
 ryBase;%0A
+import icons.DrupalIcons;%0A
 import o
@@ -1278,50 +1278,26 @@
 urn 
-IconLoader.getIcon(%22/druplicon-small.png%22)
+DrupalIcons.Drupal
 ;%0A  

Use Drupal plugin's icon