Search in sources :

Example 1 with PsAndroidDependency

use of com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency in project android by JetBrains.

the class DependencyGraphPanel method updateDetails.

private void updateDetails(@Nullable AbstractDependencyNode<? extends PsAndroidDependency> selectedNode) {
    PsAndroidDependency selected = null;
    String configurationName = null;
    if (selectedNode != null) {
        selected = selectedNode.getFirstModel();
        AbstractDependencyNode<? extends PsAndroidDependency> topDependencyNode = findTopDependencyNode(selectedNode);
        configurationName = topDependencyNode.getFirstModel().getJoinedConfigurationNames();
    }
    super.updateDetails(selected, configurationName);
}
Also used : PsAndroidDependency(com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency)

Example 2 with PsAndroidDependency

use of com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency in project android by JetBrains.

the class DependencyGraphPanel method updateIssues.

private void updateIssues(@NotNull List<AbstractDependencyNode<? extends PsAndroidDependency>> selection) {
    List<PsIssue> issues = Lists.newArrayList();
    for (AbstractDependencyNode<? extends PsAndroidDependency> node : selection) {
        for (PsAndroidDependency dependency : node.getModels()) {
            issues.addAll(myContext.getAnalyzerDaemon().getIssues().findIssues(dependency, null));
        }
    }
    displayIssues(issues);
}
Also used : PsAndroidDependency(com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency) PsIssue(com.android.tools.idea.gradle.structure.model.PsIssue)

Example 3 with PsAndroidDependency

use of com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency in project android by JetBrains.

the class ResolvedDependenciesTreeBuilder method onAllNodesExpanded.

@Override
protected void onAllNodesExpanded() {
    getReady(this).doWhenDone(() -> {
        PsAndroidDependency selection = myDependencySelectionSource.getSelection();
        myDependencySelectionDestination.setSelection(selection);
    });
}
Also used : PsAndroidDependency(com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency)

Example 4 with PsAndroidDependency

use of com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency in project android by JetBrains.

the class DependencyNodeComparator method compare.

@Override
public int compare(AbstractDependencyNode n1, AbstractDependencyNode n2) {
    PsAndroidDependency d1 = (PsAndroidDependency) n1.getFirstModel();
    PsAndroidDependency d2 = (PsAndroidDependency) n2.getFirstModel();
    return PsDependencyComparator.INSTANCE.compare(d1, d2);
}
Also used : PsAndroidDependency(com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency)

Example 5 with PsAndroidDependency

use of com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency in project android by JetBrains.

the class ResolvedDependenciesPanel method getSelection.

@Override
@Nullable
public PsAndroidDependency getSelection() {
    AbstractPsModelNode selection = getSelectionIfSingle();
    if (selection instanceof AbstractDependencyNode) {
        AbstractDependencyNode node = (AbstractDependencyNode) selection;
        List<?> models = node.getModels();
        if (!models.isEmpty()) {
            return (PsAndroidDependency) models.get(0);
        }
    }
    return null;
}
Also used : PsAndroidDependency(com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency) AbstractPsModelNode(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractPsModelNode) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsAndroidDependency (com.android.tools.idea.gradle.structure.model.android.PsAndroidDependency)9 PsIssue (com.android.tools.idea.gradle.structure.model.PsIssue)2 DependencyCellRenderer (com.android.tools.idea.gradle.structure.configurables.ui.dependencies.AbstractDeclaredDependenciesTableModel.DependencyCellRenderer)1 AbstractPsModelNode (com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractPsModelNode)1 PsArtifactDependencySpec (com.android.tools.idea.gradle.structure.model.PsArtifactDependencySpec)1 History (com.intellij.ui.navigation.History)1 ColumnInfo (com.intellij.util.ui.ColumnInfo)1 Nullable (org.jetbrains.annotations.Nullable)1