Exemple #1
0
 private boolean isNavigatableLibraryRoot() {
   VirtualFile jarRoot = getJarRoot();
   final Project project = getProject();
   if (jarRoot != null && ProjectRootsUtil.isLibraryRoot(jarRoot, project)) {
     final OrderEntry orderEntry = LibraryUtil.findLibraryEntry(jarRoot, project);
     return orderEntry != null
         && ProjectSettingsService.getInstance(project).canOpenLibraryOrSdkSettings(orderEntry);
   }
   return false;
 }
 @Nullable
 @Override
 public PsiClass getPsiClass(@NotNull JetClassOrObject classOrObject) {
   VirtualFile virtualFile = classOrObject.getContainingFile().getVirtualFile();
   if (virtualFile != null
       && LibraryUtil.findLibraryEntry(virtualFile, classOrObject.getProject()) != null) {
     if (ProjectRootsUtil.isLibraryClassFile(project, virtualFile)) {
       return getLightClassForDecompiledClassOrObject(classOrObject);
     }
     return JetSourceNavigationHelper.getOriginalClass(classOrObject);
   }
   return KotlinLightClassForExplicitDeclaration.create(psiManager, classOrObject);
 }
Exemple #3
0
  @Override
  public void navigate(boolean requestFocus) {
    final VirtualFile jarRoot = getJarRoot();
    final Project project = getProject();
    if (requestFocus && jarRoot != null && ProjectRootsUtil.isLibraryRoot(jarRoot, project)) {
      final OrderEntry orderEntry = LibraryUtil.findLibraryEntry(jarRoot, project);
      if (orderEntry != null) {
        ProjectSettingsService.getInstance(project).openLibraryOrSdkSettings(orderEntry);
        return;
      }
    }

    super.navigate(requestFocus);
  }