void (@NotNull AnActionEvent e) { DataContext context = e.getDataContext(); Project project = CommonDataKeys.PROJECT.getData(context); if (project == null) { e.getPresentation().setEnabled(false); return; } VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(context); if (files == null || files.length != 3) { e.getPresentation().setEnabled(false); } }