void (@NotNull AnActionEvent e) { boolean visible = false; final Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { final List<VirtualFile> files = getFilesToPackage(e, project); if (!files.isEmpty()) { visible = true; e.getPresentation().setText(files.size() == 1 ? JavaCompilerBundle.message("action.name.package.file") : JavaCompilerBundle .message("action.name.package.files")); } } e.getPresentation().setEnabledAndVisible(visible); }