コード例 #1
0
ファイル: PsiFileNode.java プロジェクト: jared2501/test
 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;
 }
コード例 #2
0
 @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);
 }
コード例 #3
0
ファイル: PsiFileNode.java プロジェクト: jared2501/test
  @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);
  }