Package org.fenixedu.cms.domain
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 aMenu- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMenuItem.MenuItemWrap
-
Field Summary
Fields Modifier and Type Field Description static Comparator<MenuItem>CREATION_DATE_COMPARATORstatic StringSIGNAL_CREATEDstatic StringSIGNAL_DELETEDstatic StringSIGNAL_EDITED
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(MenuItem mi)Adds a newMenuItemhas the last item.MenuItemclone(CloneCache cloneCache)intcompareTo(MenuItem o)static MenuItemcreate(Menu menu, Page page, org.fenixedu.commons.i18n.LocalizedString name, MenuItem parent)voiddelete()static voidfixOrder(List<MenuItem> sortedItems)StringgetAddress()List<MenuItem>getChildrenSorted()MenugetMenu()IntegergetPosition()booleanisEmbedded()booleanisVisible()WrapmakeWrap()WrapmakeWrap(Page page)booleanparentOrTop()voidputAt(MenuItem item, int position)Adds a children at a given position and shifts the existing items.voidremove(MenuItem mi)Removes a givenMenuItemvoidremoveFromParent()Removes theMenuItemfrom its parent.-
Methods inherited from class org.fenixedu.cms.domain.MenuItem_Base
addChildren, getChildrenSet, getCreatedBy, getCreationDate, getFolder, getName, getPage, getParent, getRelationMenuItemMenuItem, getRelationMenuItemUser, getRelationMenuMenuItem, getRelationMenuTopMenuItem, getRelationPageMenuItem, getTop, getUrl, removeChildren, setCreatedBy, setCreationDate, setFolder, setMenu, setName, setPage, setParent, setPosition, setTop, setUrl
-
-
-
-
Field Detail
-
CREATION_DATE_COMPARATOR
public static final Comparator<MenuItem> CREATION_DATE_COMPARATOR
-
SIGNAL_CREATED
public static final String SIGNAL_CREATED
- See Also:
- Constant Field Values
-
SIGNAL_DELETED
public static final String SIGNAL_DELETED
- See Also:
- Constant Field Values
-
SIGNAL_EDITED
public static final String SIGNAL_EDITED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MenuItem
public MenuItem(Menu menu)
The loggedUsercreates a new MenuItem.- Parameters:
menu- menu
-
-
Method Detail
-
getMenu
public Menu getMenu()
- Overrides:
getMenuin classMenuItem_Base
-
putAt
public void putAt(MenuItem item, int position)
Adds a children at a given position and shifts the existing items.- Parameters:
item- theMenuItemto be added.position- the position where the item should be added.
-
remove
public void remove(MenuItem mi)
Removes a givenMenuItem- Parameters:
mi- the children to be removed
-
add
public void add(MenuItem mi)
Adds a newMenuItemhas the last item.- Parameters:
mi- theMenuItemto be added.
-
removeFromParent
public void removeFromParent()
-
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()
- Returns:
- if is parent or top
-
delete
public void delete()
-
compareTo
public int compareTo(MenuItem o)
- Specified by:
compareToin interfaceComparable<MenuItem>
-
getPosition
public Integer getPosition()
- Overrides:
getPositionin classMenuItem_Base
-
create
public static MenuItem create(Menu menu, Page page, org.fenixedu.commons.i18n.LocalizedString name, MenuItem parent)
-
clone
public MenuItem clone(CloneCache cloneCache)
-
isVisible
public boolean isVisible()
-
isEmbedded
public boolean isEmbedded()
-
-