boolean (@NotNull final DataContext dataContext) { final Project project = CommonDataKeys.PROJECT.getData(dataContext); final IdeView ideView = LangDataKeys.IDE_VIEW.getData(dataContext); if (project == null || ideView == null || ideView.getDirectories().length == 0) { return false; } String pasteText = CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor); return pasteText != null && getPastedClasses(project, pasteText).length >= 1; }