BeanProperty (DataContext dataContext) { final Editor editor = CommonDataKeys.EDITOR.getData(dataContext); PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext); if (file == null && editor != null && ApplicationManager.getApplication().isUnitTestMode()) { final Project project = editor.getProject(); if (project != null) { file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); } } if (editor != null && file != null) { return getBeanProperty(editor, file); } else { return null; } }