Search in sources :

Example 1 with ConfigurableEP

use of com.intellij.openapi.options.ConfigurableEP in project android by JetBrains.

the class GradleRunnerCleanupTask method doCleanUp.

@Override
void doCleanUp(@NotNull Project project) {
    ExtensionsArea area = Extensions.getArea(project);
    ExtensionPoint<ConfigurableEP<Configurable>> projectConfigurable = area.getExtensionPoint(PROJECT_CONFIGURABLE);
    // Disable the Gradle -> Runner settings.
    for (ConfigurableEP<Configurable> configurableEP : projectConfigurable.getExtensions()) {
        if (GradleConfigurable.class.getName().equals(configurableEP.instanceClass)) {
            List<ConfigurableEP> children = new ArrayList<>();
            for (ConfigurableEP child : configurableEP.children) {
                if (!GradleRunnerConfigurable.class.getName().equals(child.instanceClass)) {
                    children.add(child);
                }
            }
            configurableEP.children = children.toArray(new ConfigurableEP[children.size()]);
        }
    }
}
Also used : ExtensionsArea(com.intellij.openapi.extensions.ExtensionsArea) ConfigurableEP(com.intellij.openapi.options.ConfigurableEP) ArrayList(java.util.ArrayList) GradleConfigurable(org.jetbrains.plugins.gradle.service.settings.GradleConfigurable) GradleConfigurable(org.jetbrains.plugins.gradle.service.settings.GradleConfigurable) GradleRunnerConfigurable(org.jetbrains.plugins.gradle.settings.GradleRunnerConfigurable) Configurable(com.intellij.openapi.options.Configurable)

Example 2 with ConfigurableEP

use of com.intellij.openapi.options.ConfigurableEP in project android by JetBrains.

the class ProjectPreferencesCleanUpTask method doCleanUp.

@Override
void doCleanUp(@NotNull Project project) {
    ExtensionsArea area = Extensions.getArea(project);
    ExtensionPoint<ConfigurableEP<Configurable>> projectConfigurable = area.getExtensionPoint(PROJECT_CONFIGURABLE);
    cleanUpPreferences(projectConfigurable, PROJECT_PREFERENCES_TO_REMOVE);
}
Also used : ExtensionsArea(com.intellij.openapi.extensions.ExtensionsArea) ConfigurableEP(com.intellij.openapi.options.ConfigurableEP)

Aggregations

ExtensionsArea (com.intellij.openapi.extensions.ExtensionsArea)2 ConfigurableEP (com.intellij.openapi.options.ConfigurableEP)2 Configurable (com.intellij.openapi.options.Configurable)1 ArrayList (java.util.ArrayList)1 GradleConfigurable (org.jetbrains.plugins.gradle.service.settings.GradleConfigurable)1 GradleRunnerConfigurable (org.jetbrains.plugins.gradle.settings.GradleRunnerConfigurable)1