void (@NotNull AnActionEvent e) { ArrangementMatchingRulesControl control = getRulesControl(e); if (control == null) { e.getPresentation().setEnabled(false); return; } final List<int[]> mappings = new ArrayList<>(); fillMappings(control, mappings); for (int[] mapping : mappings) { if (mapping[0] != mapping[1]) { e.getPresentation().setEnabled(true); return; } } e.getPresentation().setEnabled(false); }