Interface MenuItem
- All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<MenuItem>,Serializable
- All Known Implementing Classes:
MenuItemImpl
public interface MenuItem
extends Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<MenuItem>
-
Method Summary
Modifier and TypeMethodDescriptionReturns the URL (if applicable) that should be targeted when this menu is clicked.For items of typeMenuItemType.LINK, gets the alt text for the associated image.For items of typeMenuItemType.CUSTOM, returns the associated custom HTML.Convenience method that will always return the configured Label if specified.Convenience method that returns an anchor URL based on the configured MenuItemType.getId()Id of this menuItemFor items of typeMenuItemType.LINK, gets an Image associated with this Menu ItemgetLabel()Returns the label for this menu itemThe menu represented by this MenuItem.org.broadleafcommerce.cms.page.domain.PageFor items of typeMenuItemType.PAGE, returns the associated page.Returns theMenuItemTypeReturns theMenuto which this menuItem belongsReturns the order of this MenuItem in thegetParentMenu()voidsetActionUrl(String actionUrl) Sets the URL to go to if this menu is clicked.voidsetAltText(String altText) For items of typeMenuItemType.LINK, stores the alt text for the associated image.voidsetCustomHtml(String customHtml) For items of typeMenuItemType.CUSTOM, sets the associated custom HTML.voidSets the id of this menuItem.voidsetImageUrl(String imageUrl) For items of typeMenuItemType.LINK, sets an Image for this Menu ItemvoidSets the value for this menu item to display on a site.voidsetLinkedMenu(Menu menu) Sets the linked menu.voidsetLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage) For items of typeMenuItemType.PAGE, sets the associated page.voidsetMenuItemType(MenuItemType menuItemType) Sets theMenuItemTypevoidsetParentMenu(Menu menu) Sets theMenuto which this menuItem belongsvoidsetSequence(BigDecimal sequence) Sets the order of this MenuItem in thegetParentMenu()Methods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstance
-
Method Details
-
getId
Long getId()Id of this menuItem- Returns:
-
setId
Sets the id of this menuItem.- Parameters:
id-
-
getLabel
String getLabel()Returns the label for this menu item- Returns:
-
setLabel
Sets the value for this menu item to display on a site.- Parameters:
label-
-
getMenuItemType
MenuItemType getMenuItemType()Returns theMenuItemType- Returns:
-
getActionUrl
String getActionUrl()Returns the URL (if applicable) that should be targeted when this menu is clicked.- Returns:
-
setActionUrl
Sets the URL to go to if this menu is clicked.- Parameters:
actionUrl-
-
getImageUrl
String getImageUrl()For items of typeMenuItemType.LINK, gets an Image associated with this Menu Item- Returns:
-
setImageUrl
For items of typeMenuItemType.LINK, sets an Image for this Menu Item- Parameters:
imageUrl-
-
getParentMenu
Menu getParentMenu()Returns theMenuto which this menuItem belongs- Returns:
-
getLinkedMenu
Menu getLinkedMenu()The menu represented by this MenuItem. (Allows for nested menus).- Returns:
-
setSequence
Sets the order of this MenuItem in thegetParentMenu()- Parameters:
sequence-
-
getSequence
BigDecimal getSequence()Returns the order of this MenuItem in thegetParentMenu()- Returns:
-
getAltText
String getAltText()For items of typeMenuItemType.LINK, gets the alt text for the associated image.- Returns:
-
setAltText
For items of typeMenuItemType.LINK, stores the alt text for the associated image. -
getLinkedPage
org.broadleafcommerce.cms.page.domain.Page getLinkedPage()For items of typeMenuItemType.PAGE, returns the associated page.- Returns:
-
setLinkedPage
void setLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage) For items of typeMenuItemType.PAGE, sets the associated page. -
getCustomHtml
String getCustomHtml()For items of typeMenuItemType.CUSTOM, returns the associated custom HTML.- Returns:
-
setCustomHtml
For items of typeMenuItemType.CUSTOM, sets the associated custom HTML. -
getDerivedUrl
String getDerivedUrl()Convenience method that returns an anchor URL based on the configured MenuItemType. Will return getActionUrl() unless type isMenuItemType.PAGE,MenuItemType.PRODUCT, orMenuItemType.CATEGORYand will use corresponding linked URL.- Returns:
-
getDerivedLabel
String getDerivedLabel()Convenience method that will always return the configured Label if specified. If it is not specified and of typeMenuItemType.PRODUCT, orMenuItemType.CATEGORY, orMenuItemType.SUBMENU, it will return the corresponding linked name.
-