Search in sources :

Example 1 with ErrorTreeNodeDescriptor

use of com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor in project intellij-community by JetBrains.

the class ExcludeFromCompileAction method getSelectedFile.

@Nullable
private VirtualFile getSelectedFile() {
    final ErrorTreeNodeDescriptor descriptor = myErrorTreeView.getSelectedNodeDescriptor();
    ErrorTreeElement element = descriptor != null ? descriptor.getElement() : null;
    if (element != null && !(element instanceof GroupingElement)) {
        NodeDescriptor parent = descriptor.getParentDescriptor();
        if (parent instanceof ErrorTreeNodeDescriptor) {
            element = ((ErrorTreeNodeDescriptor) parent).getElement();
        }
    }
    return element instanceof GroupingElement ? ((GroupingElement) element).getFile() : null;
}
Also used : ErrorTreeElement(com.intellij.ide.errorTreeView.ErrorTreeElement) GroupingElement(com.intellij.ide.errorTreeView.GroupingElement) ErrorTreeNodeDescriptor(com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor) NodeDescriptor(com.intellij.ide.util.treeView.NodeDescriptor) ErrorTreeNodeDescriptor(com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ErrorTreeElement (com.intellij.ide.errorTreeView.ErrorTreeElement)1 ErrorTreeNodeDescriptor (com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor)1 GroupingElement (com.intellij.ide.errorTreeView.GroupingElement)1 NodeDescriptor (com.intellij.ide.util.treeView.NodeDescriptor)1 Nullable (org.jetbrains.annotations.Nullable)1