KeymapGroup (final Condition<? super AnAction> filtered, Project project) { final KeymapGroup result = KeymapGroupFactory.getInstance().createGroup(AntBundle.message("ant.targets.group.title"), AllIcons.Nodes.KeymapAnt); if (project != null) { final Map<String, KeymapGroup> buildFileNameToGroup = new HashMap<>(); ActionManagerEx actionManager = ActionManagerEx.getInstanceEx(); final String actionIdPrefix = AntConfiguration.getActionIdPrefix(project); List<String> ids = actionManager.getActionIdList(actionIdPrefix); ids.sort(null); for (final String id : ids) { if (filtered != null && !filtered.value(actionManager.getActionOrStub(id))) { continue; } String buildFileName = AntBuildTargetImpl.parseBuildFileName(project, id); if (buildFileName != null) { KeymapGroup subGroup = buildFileNameToGroup.get(buildFileName); if (subGroup == null) { subGroup = KeymapGroupFactory.getInstance().createGroup(buildFileName); buildFileNameToGroup.put(buildFileName, subGroup); result.addGroup(subGroup); } subGroup.addActionId(id); } } } return result; }