@Override public void update(AnActionEvent e) { super.update(e); final Presentation presentation = e.getPresentation(); Pair<AntBuildFileBase, AntDomTarget> antTarget = findAntTarget(e); if (antTarget == null) { presentation.setEnabled(false); presentation.setText(AntActionsBundle.message("action.RunTargetAction.text", "")); } else { presentation.setEnabled(true); presentation.setText(AntActionsBundle.message("action.RunTargetAction.text", "'" + antTarget.second.getName().getValue() + "'")); } }