int (String actionId, @NotNull List<? extends AnAction> actions, @NotNull ActionManager actionManager) { for (int i = 0; i < actions.size(); i++) { AnAction action = actions.get(i); if (action instanceof ActionStub) { if (((ActionStub)action).getId().equals(actionId)) { return i; } } else { String id = actionManager.getId(action); if (id != null && id.equals(actionId)) { return i; } } } return -1; }