Class MenuItem
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
- Direct Known Subclasses:
NavigableMenuItem
Each menu item must be under a named Menu
. Its position in the menu's hierarchy is
entirely determined by the menu item which is specified as its
parent
.
- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.The HTML that should be used to display the menu item.The order in which this item should be displayed relative to its siblings in the navigation tree.getId()
The context ID of the menu item.IfimageUrl
is set, this field should contain the alt text for that image.The url of the image that should be rendered (as an<img/>
) when displaying this menu item.getLabel()
The user-visible label for this menu item.The context ID of the namedMenu
this menu item should be under.The context ID of the menu item this menu item should be under.getType()
The type of menu item.getUrl()
The url that is visited when the menu item is clicked.int
hashCode()
void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setCustomHtml
(String customHtml) The HTML that should be used to display the menu item.void
setDisplayOrder
(Long displayOrder) The order in which this item should be displayed relative to its siblings in the navigation tree.void
The context ID of the menu item.void
setImageAltText
(String imageAltText) IfimageUrl
is set, this field should contain the alt text for that image.void
setImageUrl
(String imageUrl) The url of the image that should be rendered (as an<img/>
) when displaying this menu item.void
The user-visible label for this menu item.void
setParentMenuId
(String parentMenuId) The context ID of the namedMenu
this menu item should be under.void
setParentMenuItemId
(String parentMenuItemId) The context ID of the menu item this menu item should be under.void
The type of menu item.void
The url that is visited when the menu item is clicked.toString()
-
Constructor Details
-
MenuItem
public MenuItem()
-
-
Method Details
-
getId
The context ID of the menu item.- Returns:
- the context ID of the menu item
-
getParentMenuItemId
The context ID of the menu item this menu item should be under.This is optional, as menu items don't have to be under another menu item. If this value is not set, this menu item will be a top level menu-item in its
named menu
.If this value is set, then this menu item will appear directly under the specified menu item, however deep that parent menu item is in the overall navigation tree.
- Returns:
- (optional) the context ID of the menu item this item should appear under
-
getParentMenuId
The context ID of the namedMenu
this menu item should be under.This is required for all menu items regardless of whether they are top-level or deeply nested under other items.
If the
parent menu item
is not set, then this item will appear in the first level of this specified named menu. Otherwise, it will only appear directly under that specified menu item in the tree of this menu.- Returns:
- the context ID of the named menu whose tree this item should appear in
-
getLabel
The user-visible label for this menu item.- Returns:
- the user-visible label for this menu item
-
getUrl
The url that is visited when the menu item is clicked.- Returns:
- the url that is visited when the menu item is clicked
-
getDisplayOrder
The order in which this item should be displayed relative to its siblings in the navigation tree.- Returns:
- the order in which this item should be displayed relative to its siblings
-
getImageUrl
The url of the image that should be rendered (as an<img/>
) when displaying this menu item.This field is optional.
- Returns:
- (optional) url of the image that should be rendered when displaying this menu item
- See Also:
-
getImageAltText
IfimageUrl
is set, this field should contain the alt text for that image.- Returns:
- the alt text that should be used for the
image
(if set)
-
getCustomHtml
The HTML that should be used to display the menu item.This field is optional, and is intended to enable customization of the display of the menu item.
- Returns:
- (optional) the HTML that should be used to display the menu item
-
getType
The type of menu item. For instance, this could be a link to a category, product, or CMS page.- Returns:
- The type of menu item.
- See Also:
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setId
The context ID of the menu item.- Parameters:
id
- the context ID of the menu item
-
setParentMenuItemId
The context ID of the menu item this menu item should be under.This is optional, as menu items don't have to be under another menu item. If this value is not set, this menu item will be a top level menu-item in its
named menu
.If this value is set, then this menu item will appear directly under the specified menu item, however deep that parent menu item is in the overall navigation tree.
- Parameters:
parentMenuItemId
- (optional) the context ID of the menu item this item should appear under
-
setParentMenuId
The context ID of the namedMenu
this menu item should be under.This is required for all menu items regardless of whether they are top-level or deeply nested under other items.
If the
parent menu item
is not set, then this item will appear in the first level of this specified named menu. Otherwise, it will only appear directly under that specified menu item in the tree of this menu.- Parameters:
parentMenuId
- the context ID of the named menu whose tree this item should appear in
-
setLabel
The user-visible label for this menu item.- Parameters:
label
- the user-visible label for this menu item
-
setUrl
The url that is visited when the menu item is clicked.- Parameters:
url
- the url that is visited when the menu item is clicked
-
setDisplayOrder
The order in which this item should be displayed relative to its siblings in the navigation tree.- Parameters:
displayOrder
- the order in which this item should be displayed relative to its siblings
-
setImageUrl
The url of the image that should be rendered (as an<img/>
) when displaying this menu item.This field is optional.
- Parameters:
imageUrl
- (optional) url of the image that should be rendered when displaying this menu item- See Also:
-
setImageAltText
IfimageUrl
is set, this field should contain the alt text for that image.- Parameters:
imageAltText
- the alt text that should be used for theimage
(if set)
-
setCustomHtml
The HTML that should be used to display the menu item.This field is optional, and is intended to enable customization of the display of the menu item.
- Parameters:
customHtml
- (optional) the HTML that should be used to display the menu item
-
setType
The type of menu item. For instance, this could be a link to a category, product, or CMS page.- Parameters:
type
- The type of menu item.- See Also:
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-