List<AnAction> (@NotNull ActionGroup parentActionGroup, boolean isFirstLevel) { if (parentActionGroup instanceof HideableActionGroup) { parentActionGroup = ((HideableActionGroup)parentActionGroup).getDelegate(); } if (parentActionGroup instanceof BranchActionGroup) return Collections.emptyList(); // add per repository branches into the model as Speed Search elements and show them only if regular items were not found by mask; List<AnAction> speedSearchActions = new ArrayList<>(); if (!isFirstLevel) speedSearchActions.add(new Separator(parentActionGroup.getTemplatePresentation().getText())); for (AnAction child : parentActionGroup.getChildren(null)) { if (child instanceof ActionGroup childGroup) { if (childGroup instanceof HideableActionGroup) { childGroup = ((HideableActionGroup)childGroup).getDelegate(); } if (isFirstLevel) { speedSearchActions.addAll(createSpeedSearchActions(childGroup, false)); } else if (childGroup instanceof BranchActionGroup) { speedSearchActions.add(createSpeedSearchActionGroupWrapper(childGroup)); } } } return speedSearchActions; }