Example #1
0
 public Info(@NotNull PsiElement elementAtPointer) {
   this(
       elementAtPointer,
       Collections.singletonList(
           new TextRange(
               elementAtPointer.getTextOffset(),
               elementAtPointer.getTextOffset() + elementAtPointer.getTextLength())));
 }
 @Override
 public void actionPerformed(AnActionEvent e) {
   PsiElement element = myElements[myIndex];
   PsiElement navigationElement = element.getNavigationElement();
   PsiFile file = getContainingFile(navigationElement);
   if (file == null) return;
   VirtualFile virtualFile = file.getVirtualFile();
   if (virtualFile == null) return;
   Project project = element.getProject();
   FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
   OpenFileDescriptor descriptor =
       new OpenFileDescriptor(project, virtualFile, navigationElement.getTextOffset());
   fileEditorManager.openTextEditor(descriptor, myFocusEditor);
 }