Class MenuItem

    • Constructor Detail

      • MenuItem

        public MenuItem​(Menu menu)
        The logged User creates a new MenuItem.
        Parameters:
        menu - menu
    • Method Detail

      • putAt

        public void putAt​(MenuItem item,
                          int position)
        Adds a children at a given position and shifts the existing items.
        Parameters:
        item - the MenuItem to be added.
        position - the position where the item should be added.
      • remove

        public void remove​(MenuItem mi)
        Removes a given MenuItem
        Parameters:
        mi - the children to be removed
      • add

        public void add​(MenuItem mi)
        Adds a new MenuItem has the last item.
        Parameters:
        mi - the MenuItem to be added.
      • removeFromParent

        public void removeFromParent()
        Removes the MenuItem from its parent.

        The Parent can be a Menu or a MenuItem

      • getChildrenSorted

        public List<MenuItem> getChildrenSorted()
        Returns:
        the childrens sorted by position
      • getAddress

        public String getAddress()
        Returns:
        the URL address to visit the item.
      • parentOrTop

        public boolean parentOrTop()
        A MenuItem can not be linked with a Menu and a MenuItem at the same time
        Returns:
        if is parent or top
      • delete

        public void delete()
      • fixOrder

        public static void fixOrder​(List<MenuItem> sortedItems)
      • create

        public static MenuItem create​(Menu menu,
                                      Page page,
                                      org.fenixedu.commons.i18n.LocalizedString name,
                                      MenuItem parent)
      • makeWrap

        public Wrap makeWrap​(Page page)
      • isVisible

        public boolean isVisible()
      • isEmbedded

        public boolean isEmbedded()