Class MenuItem

java.lang.Object
pt.ist.fenixframework.core.AbstractDomainObject
org.fenixedu.cms.domain.MenuItem_Base
org.fenixedu.cms.domain.MenuItem
All Implemented Interfaces:
Serializable, Comparable<MenuItem>, Cloneable, Wrappable, pt.ist.fenixframework.DomainObject

public class MenuItem extends MenuItem_Base implements Comparable<MenuItem>, Wrappable, Cloneable
Models the items of a Menu
See Also:
  • Field Details

  • Constructor Details

    • MenuItem

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

    • getMenu

      public Menu getMenu()
      Overrides:
      getMenu in class MenuItem_Base
    • 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()
    • compareTo

      public int compareTo(MenuItem o)
      Specified by:
      compareTo in interface Comparable<MenuItem>
    • getPosition

      public Integer getPosition()
      Overrides:
      getPosition in class MenuItem_Base
    • 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)
    • clone

      public MenuItem clone(CloneCache cloneCache)
      Specified by:
      clone in interface Cloneable
    • makeWrap

      public Wrap makeWrap()
      Specified by:
      makeWrap in interface Wrappable
    • makeWrap

      public Wrap makeWrap(Page page)
    • isVisible

      public boolean isVisible()
    • isEmbedded

      public boolean isEmbedded()