Class MenuItem.MenuTreeBuilder

java.lang.Object
fr.paris.lutece.portal.web.menu.MenuItem.MenuTreeBuilder
Enclosing class:
MenuItem

public static class MenuItem.MenuTreeBuilder extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<MenuItem>
    Builds a tree from a flat list of menu items: an item whose parent is in the list becomes a child of that parent, any other item (the root page, whose parent id is 0, or the first level of a menu that does not list the root page) is a root of the tree.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MenuTreeBuilder

      public MenuTreeBuilder()
  • Method Details

    • buildTree

      public static List<MenuItem> buildTree(List<MenuItem> nodes)
      Builds a tree from a flat list of menu items: an item whose parent is in the list becomes a child of that parent, any other item (the root page, whose parent id is 0, or the first level of a menu that does not list the root page) is a root of the tree.
      Parameters:
      nodes - the flat list of menu items, in the order of the tree
      Returns:
      the root items, each one holding its children