void (@NotNull AnActionEvent e) { final Project project = getEventProject(e); final Presentation presentation = e.getPresentation(); boolean enabled = project != null && !ArtifactUtil.getArtifactWithOutputPaths(project).isEmpty(); if (IdeLanguageCustomization.getInstance().getPrimaryIdeLanguages().contains(JavaFileType.INSTANCE.getLanguage()) && ActionPlaces.MAIN_MENU.equals(e.getPlace())) { //building artifacts is a valuable functionality for Java IDEs, let's not hide 'Build Artifacts' item from the main menu presentation.setEnabled(enabled); } else { presentation.setEnabledAndVisible(enabled); } }