@Override
      protected boolean shouldShowDependenciesPanel(@NotNull DependencyAnalysisResult result) {
        Set<GlobalSearchScope> usedScopes = ((MyAnalyzeResult)result).usedScopes;
        if (usedScopes.contains(mainScope)) {
          Messages.showInfoMessage(myProject,
                                   JavaUiBundle
                                     .message("message.text.dependencies.were.successfully.collected.in.0.toolwindow", ToolWindowId.ANALYZE_DEPENDENCIES),
                                   getTemplateText());
          return true;
        }

        List<OrderEntry> usedEntries = usedScopes.stream().map(additionalScopes::get).filter(Objects::nonNull).distinct().collect(Collectors.toList());
        if (usedEntries.isEmpty()) {
          final String message = JavaUiBundle.message("analyze.module.dependency.action.dialog.message.no.dependency.found", generateSkipImportsWarning());
          if (Messages.showOkCancelDialog(myProject, message, getTemplateText(), CommonBundle.message("button.remove"),
                                          Messages.getCancelButton(),
                                          Messages.getWarningIcon()) == Messages.OK) {
            myPanel.getRootModel().removeOrderEntry(selectedEntry);
          }
          return false;
        }

        final String firstEntry = usedEntries.get(0).getPresentableName();
        final List<OrderEntry> tailEntries;
        final String secondEntry;
        if (usedEntries.size() > 1) {
          tailEntries = usedEntries.subList(1, usedEntries.size() - 1);
          secondEntry = usedEntries.get(1).getPresentableName();
        }
        else {
          tailEntries = Collections.emptyList();
          secondEntry = null;
        }

        final String howeverExportedBy = JavaUiBundle.message("analyze.module.dependency.however.exported.by",
                                                    firstEntry,
                                                    secondEntry,
                                                    StringUtil.decapitalize(selectedEntry.getPresentableName()),
                                                    tailEntries.size(),
                                                    usedEntries.size());
        final String confirmReplace = JavaUiBundle.message("analyze.module.dependency.replace.dialog.confirm.replace",
                                                    selectedEntry.getPresentableName(),
                                                    usedEntries.size(),
                                                    firstEntry);
        final String message = JavaUiBundle.message("analyze.module.dependency.replace.dialog.message",
                                                    generateSkipImportsWarning(),
                                                    howeverExportedBy, confirmReplace
                                                    );

        String[] options = {JavaUiBundle.message("button.text.replace"), JavaUiBundle.message("show.dependencies"), Messages.getCancelButton()};
        return switch (Messages.showDialog(myProject, message, getTemplateText(), options, 0, Messages.getWarningIcon())) {
          case 0 -> {
            InlineModuleDependencyAction.inlineEntry(myPanel, selectedEntry, usedEntries::contains);
            yield false;
          }
          case 1 -> true;
          default -> false;
        };
      }
@Override
      protected boolean shouldShowDependenciesPanel(@NotNull DependencyAnalysisResult result)