Package fr.paris.lutece.portal.web.menu
Class MenuItem
java.lang.Object
fr.paris.lutece.portal.web.menu.MenuItem
Represents a menu item in the portal menu structure. Each MenuItem can have child menu items, forming a tree structure.
This class provides information about the menu item such as its page ID, parent ID, name, description, level, menu index, sub-menu index, current page ID, role, and its children. It also provides a builder for easy construction and a utility to build a tree from a flat list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MenuItem.Builderbuilder()Gets the list of child menu items.Gets the current page ID associated with this menu item.getLevel()Gets the level of this menu item in the menu hierarchy.Gets the index of this menu item in the menu.Gets the description of the page for this menu item.intGets the page ID of this menu item.Gets the name of the page for this menu item.intGets the parent page ID of this menu item.getRole()Gets the role required to view this menu item.Gets the index of this menu item in the submenu.
-
Constructor Details
-
MenuItem
public MenuItem(int nPageId, int nParentId, String strPageName, String strPageDescription, Integer nLevel, Integer nMenuIndex, Integer nSubMenuIndex, Integer nCurrentPageId, String strRole) Constructs a MenuItem with the specified properties.- Parameters:
nPageId- the page ID of the menu itemnParentId- the parent page ID (0 if root)strPageName- the name of the pagestrPageDescription- the description of the pagenLevel- the level in the menu hierarchynMenuIndex- the index in the menunSubMenuIndex- the index in the submenunCurrentPageId- the current page IDstrRole- the role required to view this menu item
-
-
Method Details
-
getPageId
public int getPageId()Gets the page ID of this menu item.- Returns:
- the page ID
-
getParentId
public int getParentId()Gets the parent page ID of this menu item.- Returns:
- the parent page ID (0 if root)
-
getPageName
Gets the name of the page for this menu item.- Returns:
- the page name
-
getPageDescription
Gets the description of the page for this menu item.- Returns:
- the page description
-
getLevel
Gets the level of this menu item in the menu hierarchy.- Returns:
- the level (may be null)
-
getMenuIndex
Gets the index of this menu item in the menu.- Returns:
- the menu index (may be null)
-
getSubMenuIndex
Gets the index of this menu item in the submenu.- Returns:
- the submenu index (may be null)
-
getCurrentPageId
Gets the current page ID associated with this menu item.- Returns:
- the current page ID (may be null)
-
getRole
Gets the role required to view this menu item.- Returns:
- the role string
-
getChildren
Gets the list of child menu items.- Returns:
- the list of children
-
builder
-