@Entity public class MenuItemImpl extends Object implements MenuItem, org.broadleafcommerce.common.extensibility.jpa.copy.ProfileEntity
| Modifier and Type | Class and Description |
|---|---|
static class |
MenuItemImpl.Presentation |
| Modifier and Type | Field and Description |
|---|---|
protected String |
actionUrl |
protected String |
altText |
protected String |
customHtml |
protected Long |
id |
protected org.broadleafcommerce.common.media.domain.Media |
image |
protected String |
label |
protected Menu |
linkedMenu |
protected org.broadleafcommerce.cms.page.domain.Page |
linkedPage |
protected Menu |
parentMenu |
protected BigDecimal |
sequence |
protected String |
type |
| Constructor and Description |
|---|
MenuItemImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends MenuItem> |
createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) |
String |
getActionUrl()
Returns the URL (if applicable) that should be targeted when this menu is clicked.
|
String |
getAltText()
For items of type
MenuItemType.LINK, gets the alt text for the associated image. |
String |
getCustomHtml()
For items of type
MenuItemType.CUSTOM, returns the associated custom HTML. |
String |
getDerivedLabel()
Convenience method that will always return the configured Label if specified.
|
String |
getDerivedUrl()
Convenience method that returns an anchor URL based on the configured MenuItemType.
|
Long |
getId()
Id of this menuItem
|
org.broadleafcommerce.common.media.domain.Media |
getImage()
For items of type
MenuItemType.LINK, gets any Media associated with this Menu Item |
String |
getLabel()
Returns the label for this menu item
|
Menu |
getLinkedMenu()
The menu represented by this MenuItem.
|
org.broadleafcommerce.cms.page.domain.Page |
getLinkedPage()
For items of type
MenuItemType.PAGE, returns the associated page. |
MenuItemType |
getMenuItemType()
Returns the
MenuItemType |
Menu |
getParentMenu()
Returns the
Menu to which this menuItem belongs |
BigDecimal |
getSequence()
Returns the order of this MenuItem in the
MenuItem.getParentMenu() |
void |
setActionUrl(String actionUrl)
Sets the URL to go to if this menu is clicked.
|
void |
setAltText(String altText)
For items of type
MenuItemType.LINK, stores the alt text for the associated image. |
void |
setCustomHtml(String customHtml)
For items of type
MenuItemType.CUSTOM, sets the associated custom HTML. |
void |
setId(Long id)
Sets the id of this menuItem.
|
void |
setImage(org.broadleafcommerce.common.media.domain.Media image)
For items of type
MenuItemType.LINK, sets an Image for this Menu Item |
void |
setLabel(String label)
Sets the value for this menu item to display on a site.
|
void |
setLinkedMenu(Menu linkedMenu)
Sets the linked menu.
|
void |
setLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage)
For items of type
MenuItemType.PAGE, sets the associated page. |
void |
setMenuItemType(MenuItemType menuItemType)
Sets the
MenuItemType |
void |
setParentMenu(Menu parentMenu)
Sets the
Menu to which this menuItem belongs |
void |
setSequence(BigDecimal sequence)
Sets the order of this MenuItem in the
MenuItem.getParentMenu() |
protected Long id
protected String label
protected String type
protected BigDecimal sequence
protected Menu parentMenu
protected String actionUrl
protected org.broadleafcommerce.common.media.domain.Media image
protected String altText
protected Menu linkedMenu
protected org.broadleafcommerce.cms.page.domain.Page linkedPage
protected String customHtml
public void setId(Long id)
MenuItempublic MenuItemType getMenuItemType()
MenuItemMenuItemTypegetMenuItemType in interface MenuItempublic void setMenuItemType(MenuItemType menuItemType)
MenuItemMenuItemTypesetMenuItemType in interface MenuItempublic String getLabel()
MenuItempublic void setLabel(String label)
MenuItempublic String getActionUrl()
MenuItemgetActionUrl in interface MenuItempublic void setActionUrl(String actionUrl)
MenuItemsetActionUrl in interface MenuItempublic org.broadleafcommerce.common.media.domain.Media getImage()
MenuItemMenuItemType.LINK, gets any Media associated with this Menu Itempublic void setImage(org.broadleafcommerce.common.media.domain.Media image)
MenuItemMenuItemType.LINK, sets an Image for this Menu Itempublic BigDecimal getSequence()
MenuItemMenuItem.getParentMenu()getSequence in interface MenuItempublic void setSequence(BigDecimal sequence)
MenuItemMenuItem.getParentMenu()setSequence in interface MenuItempublic Menu getParentMenu()
MenuItemMenu to which this menuItem belongsgetParentMenu in interface MenuItempublic void setParentMenu(Menu parentMenu)
MenuItemMenu to which this menuItem belongssetParentMenu in interface MenuItempublic Menu getLinkedMenu()
MenuItemgetLinkedMenu in interface MenuItempublic void setLinkedMenu(Menu linkedMenu)
MenuItemsetLinkedMenu in interface MenuItempublic String getAltText()
MenuItemMenuItemType.LINK, gets the alt text for the associated image.getAltText in interface MenuItempublic void setAltText(String altText)
MenuItemMenuItemType.LINK, stores the alt text for the associated image.setAltText in interface MenuItempublic org.broadleafcommerce.cms.page.domain.Page getLinkedPage()
MenuItemMenuItemType.PAGE, returns the associated page.getLinkedPage in interface MenuItempublic void setLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage)
MenuItemMenuItemType.PAGE, sets the associated page.setLinkedPage in interface MenuItempublic String getCustomHtml()
MenuItemMenuItemType.CUSTOM, returns the associated custom HTML.getCustomHtml in interface MenuItempublic void setCustomHtml(String customHtml)
MenuItemMenuItemType.CUSTOM, sets the associated custom HTML.setCustomHtml in interface MenuItempublic String getDerivedUrl()
MenuItemMenuItemType.PAGE,
MenuItemType.PRODUCT, or MenuItemType.CATEGORY and will use corresponding linked URL.getDerivedUrl in interface MenuItempublic String getDerivedLabel()
MenuItemMenuItemType.PRODUCT, or MenuItemType.CATEGORY,
or MenuItemType.SUBMENU, it will return the corresponding linked name.getDerivedLabel in interface MenuItempublic <G extends MenuItem> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException
createOrRetrieveCopyInstance in interface org.broadleafcommerce.common.copy.MultiTenantCloneable<MenuItem>CloneNotSupportedExceptionCopyright © 2015. All rights reserved.