boolean (@NotNull String path) { ProgressManager.getInstance().run(new Task.Modal(getCurrentProject(), EclipseBundle.message("eclipse.import.scanning"), true) { @Override public void run(@NotNull ProgressIndicator indicator) { List<String> roots = new ArrayList<>(); EclipseProjectFinder.findModuleRoots(roots, path, (@NlsSafe var path12) -> { final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator(); if (progressIndicator != null) { if (progressIndicator.isCanceled()) return false; progressIndicator.setText2(path12); } return true; }); roots.sort((path1, path2) -> { final String projectName1 = EclipseProjectFinder.findProjectName(path1); final String projectName2 = EclipseProjectFinder.findProjectName(path2); return projectName1 != null && projectName2 != null ? projectName1.compareToIgnoreCase(projectName2) : 0; }); getParameters().workspace = roots; getParameters().root = path; } @Override public void onCancel() { getParameters().workspace = null; getParameters().root = null; } }); setFileToImport(path); return getParameters().workspace != null; }