Interface IMenuItem

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractContainerMenuItem, AbstractMenuItem, ApplicationMenuItem, CmsMenuItem, ContainerMenuItem, LinkMenuItem, RootMenuItem, SeparatorMenuItem, TopLevelGroupMenuItem

public interface IMenuItem extends Cloneable
  • Method Details

    • getGuid

      String getGuid()
      Get the menu item's unique identifier.
      Returns:
      The menu item's unique identifier.
    • isRootMenuItem

      boolean isRootMenuItem()
      Indicates if this is the root menu item.
      Returns:
      true if this menu item is a RootMenuItem or false otherwise.
    • isTopLevelGroupMenuItem

      boolean isTopLevelGroupMenuItem()
      Indicates if this menu item is a top-level group.
      Returns:
      true if this menu item is a TopLevelGroupMenuItem or false otherwise.
    • isContainerMenuItem

      boolean isContainerMenuItem()
      Indicates if this menu item is a container.
      Returns:
      true if this menu item is a ContainerMenuItem or false otherwise.
    • isApplicationMenuItem

      boolean isApplicationMenuItem()
      Indicates if this menu item is an application menu item.
      Returns:
      true if this menu item is an ApplicationMenuItem, or false otherwise.
    • isLinkMenuItem

      boolean isLinkMenuItem()
      Indicates if this menu item is a link menu item.
      Returns:
      true if this menu item is an LinkMenuItem, or false otherwise.
    • isCmsMenuItem

      boolean isCmsMenuItem()
      Indicates if this menu item is a CMS menu item.
      Returns:
      true if this menu item is an CmsMenuItem, or false otherwise.
    • isSeparatorMenuItem

      boolean isSeparatorMenuItem()
      Indicates if this menu item is a separator.
      Returns:
      true if this menu item is a SeparatorMenuItem, or false otherwise.
    • hasChildren

      boolean hasChildren()
      Check if this menu item has children.
      Returns:
      true if this menu item has children, or false otherwise.
    • getChildrenCount

      int getChildrenCount()
      Get the number of children of this node.
      Returns:
      The number of children.
    • children

      IMenuItem[] children()
      Get the children of this menu item. If the menu item has no children, an empty array is returned.
      Returns:
      The children of this menu item (never null).
    • getLevel

      int getLevel()
      Get the level of this menu item. 0 for menu items that do not have a parent.
      Returns:
      The level of this menu item.
    • getLevelRelative

      int getLevelRelative(IMenuItem p_menuItem)
      Get the level of this menu item relative to the given menu item.
      Returns:
      The relative level of this menu item.
    • hasParent

      boolean hasParent()
      Indicates if this menu item has a parent.
      Returns:
      true if this menu item has a parent or false otherwise.
    • getParent

      IMenuItem getParent()
      Get the parent of this menu item.
      Returns:
      The parent of this menu item, or null if this menu item has no parent.
    • isFirstChild

      boolean isFirstChild()
      Check if this menu item is the first child of it's parent.
      Returns:
      true if this menu item has a parent and is the first child of this parent, or false otherwise.
    • isLastChild

      boolean isLastChild()
      Check if this menu item is the last child of it's parent.
      Returns:
      true if this menu item has a parent and is the last child of this parent, or false otherwise.
    • getPreviousSibling

      IMenuItem getPreviousSibling()
      Get the previous sibling of this menu item.
      Returns:
      If this menu item has a parent and this menu item is not the first child of this parent, the previous sibling of this menu item is returned. In all other cases the return value is null.
    • getNextSibling

      IMenuItem getNextSibling()
      Get the next sibling of this menu item.
      Returns:
      If this menu item has a parent and this menu item is not the last child of this parent, the next sibling of this menu item is returned. In all other cases the return value is null.
    • getDescendantOrSelf

      IMenuItem getDescendantOrSelf(String p_strId)
      Get the menu item with the specified unique identifier from this subtree.
      Parameters:
      p_strId - The menu item's unique identifier.
      Returns:
      The menu item with the given unique identifier, or null if the menu item does not exist in this subtree.
    • hasProperty

      boolean hasProperty(String p_strName)
      Test if this menu item has the given property.
      Parameters:
      p_strName - The property name.
      Returns:
      true if this menu item has the property, or false otherwise.
    • getProperty

      String getProperty(String p_strName)
      Get the value of the given property
      Parameters:
      p_strName - The property name.
      Returns:
      The value of the property.
    • getProperties

      SortedMap<String,String> getProperties()
      Get the menu item's properties.
      Returns:
      An immutable map of the menu item's properties, never null.
    • hasName

      boolean hasName(String p_strLang)
      Test if this menu item has a name in the specified language.
      Parameters:
      p_strLang - The language.
      Returns:
      true if this menu item has a name in the given language, or false otherwise.
    • getName

      String getName(String p_strLang)
      Get the name of this menu item in the specified language.
      Parameters:
      p_strLang - The language.
      Returns:
      The name of the menu item in the given language.
    • getNames

      SortedMap<String,String> getNames()
      Get the menu item's language dependent names.
      Returns:
      An immutable map of the menu item's names, never null.