void (@NotNull AnActionEvent e) { VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); boolean enabled = file != null && file.isDirectory(); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setEnabledAndVisible(enabled); } else { e.getPresentation().setEnabled(enabled); } }