IDEADEV-41383 Inject language intention: "Add library" dialog is shown under popup

This commit is contained in:
Gregory Shrago
2009-11-16 23:44:47 +03:00
parent ab18050c08
commit 44fbf87e45
3 changed files with 13 additions and 5 deletions
@@ -326,11 +326,11 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix {
});
}
public static void ensureAnnotationsJarInPath(final Module module, String annotationName) {
if (module == null) return;
public static boolean ensureAnnotationsJarInPath(final Module module, String annotationName) {
if (module == null) return false;
final PsiClass psiClass = JavaPsiFacade.getInstance(module.getProject())
.findClass(annotationName, GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module));
if (psiClass != null) return;
if (psiClass != null) return true;
final LocateLibraryDialog dialog = new LocateLibraryDialog(
module, PathManager.getLibPath(), "annotations.jar",
QuickFixBundle.message("add.library.annotations.description"));
@@ -341,6 +341,8 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix {
addJarToRoots(dialog.getResultingLibraryPath(), module, null);
}
}.execute();
return true;
}
return false;
}
}