void (@NotNull AnActionEvent e) { final DirDiffTableModel model = getModel(e); final JTable table = getTable(e); if (table != null && model != null && model.isOperationsEnabled()) { for (DirDiffElementImpl element : model.getSelectedElements()) { if (isEnabledFor(element)) { e.getPresentation().setEnabled(true); return; } } } e.getPresentation().setEnabled(false); }