PsiElement (DataContext dataContext) { final Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor == null) return null; final PsiElement element = TargetElementUtil.getInstance().findTargetElement(editor, TargetElementUtil.ELEMENT_NAME_ACCEPTED, editor.getCaretModel().getOffset()); if (element == null) { return null; } return canBeAppliedFor(element) ? element : null; }