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;
}
Aggregations