PsiElement (@NotNull DataContext dataContext) { Object element = ArrayUtil.getFirstElement(dataContext.getData(PlatformCoreDataKeys.SELECTED_ITEMS)); if (!(element instanceof HierarchyNodeDescriptor)) return null; return getElementFromDescriptor((HierarchyNodeDescriptor)element); }