code: private void createMenus(Collection<ActionRef> parents, Collection<ActionRef> actions)
      {
          for (final ActionRef action : actions)
          {
              final Featurable menu = createMenu(action);
              if (!action.getRefs().isEmpty())
              {
                  generateSubMenu(actions, action, menu);
              }
              else if (action.hasCancel())
              {
                  previous.put(action, parents);
                  generateCancel(action, menu);
              }
          }
          for (final Featurable current : menus)
          {
              handler.add(current);
          }
      }
docs: Create menus from actions.
  
  @param parents The parents menu.
  @param actions The actions to create as menu.