Search in sources :

Example 1 with PsAllModulesFakeModule

use of com.android.tools.idea.gradle.structure.configurables.android.dependencies.PsAllModulesFakeModule 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)

Example 2 with PsAllModulesFakeModule

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

the class DependenciesPerspectiveConfigurable method getExtraTopModules.

@Override
@NotNull
protected List<PsModule> getExtraTopModules() {
    if (myExtraTopModules.isEmpty()) {
        PsProject project = getContext().getProject();
        myExtraTopModules.add(new PsAllModulesFakeModule(project));
    }
    return myExtraTopModules;
}
Also used : PsProject(com.android.tools.idea.gradle.structure.model.PsProject) PsAllModulesFakeModule(com.android.tools.idea.gradle.structure.configurables.android.dependencies.PsAllModulesFakeModule) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsAllModulesFakeModule (com.android.tools.idea.gradle.structure.configurables.android.dependencies.PsAllModulesFakeModule)2 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 PsProject (com.android.tools.idea.gradle.structure.model.PsProject)1 PsAndroidModule (com.android.tools.idea.gradle.structure.model.android.PsAndroidModule)1 PsJavaModule (com.android.tools.idea.gradle.structure.model.java.PsJavaModule)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1