void (@NotNull ActionMenu am, StringBuilder out, int indent) { // exec at EDT for (Component each : am.getPopupMenu().getComponents()) { if (each == null) { continue; } if (!(each instanceof JMenuItem)) { continue; } out.append("\t".repeat(Math.max(0, indent))); String txt = ((JMenuItem)each).getText(); if (txt == null || txt.isEmpty()) { txt = "null"; } out.append(txt); out.append('\n'); if (each instanceof ActionMenu) { _dumpActionMenuKids((ActionMenu)each, out, indent + 1); } } }