Search in sources :

Example 1 with CalledWithReadLock

use of org.jetbrains.annotations.CalledWithReadLock in project intellij-community by JetBrains.

the class AnnotateStackTraceAction method getHyperlinkVirtualFile.

@Nullable
@CalledWithReadLock
private static VirtualFile getHyperlinkVirtualFile(@NotNull List<RangeHighlighter> links) {
    RangeHighlighter key = ContainerUtil.getLastItem(links);
    if (key == null)
        return null;
    HyperlinkInfo info = EditorHyperlinkSupport.getHyperlinkInfo(key);
    if (!(info instanceof FileHyperlinkInfo))
        return null;
    OpenFileDescriptor descriptor = ((FileHyperlinkInfo) info).getDescriptor();
    return descriptor != null ? descriptor.getFile() : null;
}
Also used : RangeHighlighter(com.intellij.openapi.editor.markup.RangeHighlighter) OpenFileDescriptor(com.intellij.openapi.fileEditor.OpenFileDescriptor) FileHyperlinkInfo(com.intellij.execution.filters.FileHyperlinkInfo) FileHyperlinkInfo(com.intellij.execution.filters.FileHyperlinkInfo) HyperlinkInfo(com.intellij.execution.filters.HyperlinkInfo) CalledWithReadLock(org.jetbrains.annotations.CalledWithReadLock) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

FileHyperlinkInfo (com.intellij.execution.filters.FileHyperlinkInfo)1 HyperlinkInfo (com.intellij.execution.filters.HyperlinkInfo)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1 CalledWithReadLock (org.jetbrains.annotations.CalledWithReadLock)1 Nullable (org.jetbrains.annotations.Nullable)1