void (@NotNull AnActionEvent e) { boolean isEnabled; if (ActionPlaces.isPopupPlace(e.getPlace())) { Project project = e.getProject(); ServiceView selectedView = getSelectedView(e); isEnabled = project != null && selectedView != null && ((ServiceViewManagerImpl)ServiceViewManager.getInstance(project)).isSplitByTypeEnabled(selectedView); } else { isEnabled = false; } e.getPresentation().setEnabledAndVisible(isEnabled); }