Group (@Nullable Condition<? super AnAction> filtered, Group mainGroup, @Nullable Keymap keymap) { mainGroup.initIds(); Set<String> result = new HashSet<>(); ActionManagerImpl actionManager = (ActionManagerImpl)ActionManagerEx.getInstanceEx(); if (keymap != null) { for (String id : keymap.getActionIdList()) { if (id.startsWith(EDITOR_PREFIX) && actionManager.getActionOrStub("$" + id.substring(6)) != null) { continue; } if (!id.startsWith(QuickList.QUICK_LIST_PREFIX) && !mainGroup.containsId(id)) { result.add(id); } } } // add all registered actions List<String> namedGroups = new ArrayList<>(); for (String id : actionManager.getActionIdList("")) { AnAction actionOrStub = actionManager.getActionOrStub(id); if (isNonExecutableActionGroup(id, actionOrStub) || id.startsWith(QuickList.QUICK_LIST_PREFIX) || mainGroup.containsId(id) || result.contains(id)) { continue; } if (actionOrStub instanceof ActionGroup) { namedGroups.add(id); } else { result.add(id); } } filterOtherActionsGroup(result); Group group = new Group(KeyMapBundle.message("other.group.title"), null, () -> AllIcons.Nodes.KeymapOther); for (AnAction action : getActions("Other.KeymapGroup")) { addAction(group, action, actionManager, filtered, false, false); } Set<String> groupIds = group.initIds(); // a quick hack to skip already included groups JBTreeTraverser<String> traverser = JBTreeTraverser.from(o -> actionManager.getParentGroupIds(o)); for (String actionId : namedGroups) { if (traverser.withRoot(actionId).unique().traverse() .filter(o -> mainGroup.containsId(o) || group.containsId(o)).isNotEmpty()) { continue; } result.add(actionId); } ContainerUtil.sort(group.getChildren(), Comparator.comparing(o -> ((Group)o).getName())); result.removeAll(groupIds); for (String id : ContainerUtil.sorted(result, Comparator.comparing(o -> getTextToCompare(o)))) { AnAction actionOrStub = actionManager.getActionOrStub(id); if (actionOrStub == null || isSearchable(actionOrStub)) { if (filtered == null || filtered.value(actionOrStub)) { group.addActionId(id); } } } return group; }