void (@NotNull final AnActionEvent e) { final Presentation presentation = e.getPresentation(); CaptionSelection selection = e.getData(CaptionSelection.DATA_KEY); if (selection == null) { presentation.setEnabled(false); } else { presentation.setEnabled(selection.getContainer() != null && selection.getFocusedIndex() >= 0); if (!selection.isRow()) { presentation.setText(myColumnText); if (myColumnIcon != null) { presentation.setIcon(myColumnIcon); } } else { presentation.setText(myRowText); if (myRowIcon != null) { presentation.setIcon(myRowIcon); } } } }