Search in sources :

Example 1 with DependenciesPanel

use of com.intellij.packageDependencies.ui.DependenciesPanel in project intellij-community by JetBrains.

the class DependenciesPanelTest method doTestDependenciesTrees.

private void doTestDependenciesTrees(AnalysisScope scope, String expectedLeftTree, String expectedRightTree) {
    DependenciesBuilder builder = new ForwardDependenciesBuilder(myProject, scope);
    builder.analyze();
    DependenciesPanel dependenciesPanel = new DependenciesPanel(myProject, builder);
    try {
        JTree leftTree = dependenciesPanel.getLeftTree();
        TreeUtil.expandAll(leftTree);
        PlatformTestUtil.assertTreeEqual(leftTree, expectedLeftTree, true);
        JTree rightTree = dependenciesPanel.getRightTree();
        TreeUtil.expandAll(rightTree);
        PlatformTestUtil.assertTreeEqual(rightTree, expectedRightTree, true);
    } finally {
        Disposer.dispose(dependenciesPanel);
    }
}
Also used : DependenciesBuilder(com.intellij.packageDependencies.DependenciesBuilder) ForwardDependenciesBuilder(com.intellij.packageDependencies.ForwardDependenciesBuilder) DependenciesPanel(com.intellij.packageDependencies.ui.DependenciesPanel) ForwardDependenciesBuilder(com.intellij.packageDependencies.ForwardDependenciesBuilder)

Example 2 with DependenciesPanel

use of com.intellij.packageDependencies.ui.DependenciesPanel in project intellij-community by JetBrains.

the class DependenciesHandlerBase method onSuccess.

private void onSuccess(final List<DependenciesBuilder> builders) {
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(() -> {
        if (shouldShowDependenciesPanel(builders)) {
            final String displayName = getPanelDisplayName(builders);
            DependenciesPanel panel = new DependenciesPanel(myProject, builders, myExcluded);
            Content content = ContentFactory.SERVICE.getInstance().createContent(panel, displayName, false);
            content.setDisposer(panel);
            panel.setContent(content);
            DependenciesToolWindow.getInstance(myProject).addContent(content);
        }
    });
}
Also used : DependenciesPanel(com.intellij.packageDependencies.ui.DependenciesPanel) Content(com.intellij.ui.content.Content)

Aggregations

DependenciesPanel (com.intellij.packageDependencies.ui.DependenciesPanel)2 DependenciesBuilder (com.intellij.packageDependencies.DependenciesBuilder)1 ForwardDependenciesBuilder (com.intellij.packageDependencies.ForwardDependenciesBuilder)1 Content (com.intellij.ui.content.Content)1