public static void addAction(KeymapGroup group, AnAction action, ActionManager actionManager,
                               Condition<? super AnAction> filtered, boolean forceNonPopup, boolean skipUnnamedGroups) {
    if (action instanceof ActionGroup) {
      if (forceNonPopup || skipUnnamedGroups) {
        Presentation presentation = getTemplatePresentation(action);
        String text = presentation.getText();
        boolean skip = forceNonPopup || StringUtil.isEmpty(text);
        KeymapGroup tgtGroup;
        if (skip) {
          tgtGroup = group;
        }
        else {
          tgtGroup = new Group(text, actionManager.getId(action), presentation.getIcon());
          group.addGroup(tgtGroup);
        }
        AnAction[] actions = getActions((ActionGroup)action, actionManager);
        for (AnAction childAction : actions) {
          addAction(tgtGroup, childAction, actionManager, filtered, forceNonPopup, skipUnnamedGroups);
        }
        ((Group)tgtGroup).normalizeSeparators();
      }
      else {
        Group subGroup = createGroup((ActionGroup)action, false, filtered);
        if (subGroup.getSize() > 0) {
          group.addGroup(subGroup);
        }
      }
    }
    else if (action instanceof Separator) {
      if (group instanceof Group && (filtered == null || filtered.value(action))) {
        ((Group)group).addSeparator();
      }
    }
    else {
      if (filtered == null || filtered.value(action)) {
        String id = actionManager.getId(action);
        if (id != null) group.addActionId(id);
      }
    }
  }
public static void addAction(KeymapGroup group, AnAction action, ActionManager actionManager,
                               Condition<? super AnAction> filtered, boolean forceNonPopup, boolean skipUnnamedGroups)