Object (@NotNull String dataId) { if (CommonDataKeys.PSI_ELEMENT.is(dataId)) { Object userObject = TreeUtil.getUserObject(ContainerUtil.getFirstItem(getSelection())); return userObject instanceof PsiElement ? userObject : null; } return null; }