Search in sources :

Example 1 with ModuleDependencyNode

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

the class DependenciesTreeRootNode method createChildren.

@Override
@NotNull
protected List<? extends AbstractPsModelNode> createChildren() {
    T model = getFirstModel();
    DependencyCollector collector = myDependencyCollectorFunction.apply(model);
    List<AbstractDependencyNode> children = Lists.newArrayList();
    for (Map.Entry<LibraryDependencySpecs, List<PsLibraryAndroidDependency>> entry : collector.libraryDependenciesBySpec.entrySet()) {
        LibraryDependencyNode child = new LibraryDependencyNode(this, entry.getValue());
        children.add(child);
    }
    for (Map.Entry<String, List<PsModuleAndroidDependency>> entry : collector.moduleDependenciesByGradlePath.entrySet()) {
        ModuleDependencyNode child = new ModuleDependencyNode(this, entry.getValue());
        children.add(child);
    }
    Collections.sort(children, DependencyNodeComparator.INSTANCE);
    return children;
}
Also used : AbstractDependencyNode(com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.AbstractDependencyNode) LibraryDependencyNode(com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.LibraryDependencyNode) ModuleDependencyNode(com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.ModuleDependencyNode) List(java.util.List) Map(java.util.Map) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

AbstractDependencyNode (com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.AbstractDependencyNode)1 LibraryDependencyNode (com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.LibraryDependencyNode)1 ModuleDependencyNode (com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.ModuleDependencyNode)1 List (java.util.List)1 Map (java.util.Map)1 NotNull (org.jetbrains.annotations.NotNull)1