Search in sources :

Example 1 with JavaModuleDependenciesConfigurable

use of com.android.tools.idea.gradle.structure.configurables.java.dependencies.JavaModuleDependenciesConfigurable in project android by JetBrains.

the class DependenciesPerspectiveConfigurable method getConfigurable.

@Override
@Nullable
protected NamedConfigurable<? extends PsModule> getConfigurable(@NotNull PsModule module) {
    AbstractDependenciesConfigurable<? extends PsModule> configurable;
    if (module instanceof PsAllModulesFakeModule) {
        configurable = myExtraTopConfigurables.get(module);
        if (configurable == null) {
            configurable = new ProjectDependenciesConfigurable(module, getContext(), getExtraTopModules());
            configurable.setHistory(myHistory);
            myExtraTopConfigurables.put(module, configurable);
        }
    } else {
        String gradlePath = module.getGradlePath();
        configurable = myConfigurablesByGradlePath.get(gradlePath);
        if (configurable == null) {
            if (module instanceof PsAndroidModule) {
                PsAndroidModule androidModule = (PsAndroidModule) module;
                configurable = new AndroidModuleDependenciesConfigurable(androidModule, getContext(), getExtraTopModules());
                configurable.setHistory(myHistory);
                myConfigurablesByGradlePath.put(gradlePath, configurable);
            } else if (module instanceof PsJavaModule) {
                PsJavaModule javaModule = (PsJavaModule) module;
                configurable = new JavaModuleDependenciesConfigurable(javaModule, getContext(), getExtraTopModules());
            }
        }
    }
    return configurable;
}
Also used : PsJavaModule(com.android.tools.idea.gradle.structure.model.java.PsJavaModule) AndroidModuleDependenciesConfigurable(com.android.tools.idea.gradle.structure.configurables.android.dependencies.module.AndroidModuleDependenciesConfigurable) JavaModuleDependenciesConfigurable(com.android.tools.idea.gradle.structure.configurables.java.dependencies.JavaModuleDependenciesConfigurable) PsAllModulesFakeModule(com.android.tools.idea.gradle.structure.configurables.android.dependencies.PsAllModulesFakeModule) ProjectDependenciesConfigurable(com.android.tools.idea.gradle.structure.configurables.android.dependencies.project.ProjectDependenciesConfigurable) PsAndroidModule(com.android.tools.idea.gradle.structure.model.android.PsAndroidModule) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsAllModulesFakeModule (com.android.tools.idea.gradle.structure.configurables.android.dependencies.PsAllModulesFakeModule)1 AndroidModuleDependenciesConfigurable (com.android.tools.idea.gradle.structure.configurables.android.dependencies.module.AndroidModuleDependenciesConfigurable)1 ProjectDependenciesConfigurable (com.android.tools.idea.gradle.structure.configurables.android.dependencies.project.ProjectDependenciesConfigurable)1 JavaModuleDependenciesConfigurable (com.android.tools.idea.gradle.structure.configurables.java.dependencies.JavaModuleDependenciesConfigurable)1 PsAndroidModule (com.android.tools.idea.gradle.structure.model.android.PsAndroidModule)1 PsJavaModule (com.android.tools.idea.gradle.structure.model.java.PsJavaModule)1 Nullable (org.jetbrains.annotations.Nullable)1