Class BadgeItem

All Implemented Interfaces:
IComponentItem

public class BadgeItem extends AbstractColorComponentItem<BadgeItem>
A Pojo for badge (To use with BadgeTag)
Since:
jcms-11.0.0
  • Field Details

    • url

      protected String url
    • htmlTag

      protected String htmlTag
    • labelTag

      protected String labelTag
    • labelDataAttributes

      protected DataAttribute labelDataAttributes
    • labelHtmlAttributes

      protected String labelHtmlAttributes
    • icon

      protected String icon
    • data

      protected Data data
    • rightButton

      protected Button rightButton
    • tooltip

      protected String tooltip
    • tooltipAlt

      protected String tooltipAlt
    • appendHtml

      protected String appendHtml
  • Constructor Details

    • BadgeItem

      public BadgeItem()
    • BadgeItem

      public BadgeItem(Category category, String lang)
  • Method Details

    • getLabel

      public String getLabel(String userLang)
    • getCSS

      public String getCSS()
      Specified by:
      getCSS in interface IComponentItem
      Overrides:
      getCSS in class AbstractComponentItem<BadgeItem>
    • getCategoryBrowserList

      public List<CategoryBrowser> getCategoryBrowserList(CategoryBrowserContext categoryBrowserContext)
    • getDataAttributes

      public DataAttribute getDataAttributes()
      Specified by:
      getDataAttributes in interface IComponentItem
      Overrides:
      getDataAttributes in class AbstractComponentItem<BadgeItem>
    • getLabelDataAttributes

      public DataAttribute getLabelDataAttributes()
      Returns the data attributes rendered only on the badge label.
      Returns:
      the label data attributes
      Since:
      jcms-11.0.1
    • labelDataAttributes

      public BadgeItem labelDataAttributes(DataAttribute labelDataAttributes)
      Sets the data attributes rendered only on the badge label.
      Parameters:
      labelDataAttributes - the label data attributes
      Returns:
      this badge item
      Since:
      jcms-11.0.1
    • getLabelHtmlAttributes

      public String getLabelHtmlAttributes()
      Returns the HTML attributes rendered only on the badge label.
      Returns:
      the label HTML attributes
      Since:
      jcms-11.0.1
    • labelHtmlAttributes

      public BadgeItem labelHtmlAttributes(String labelHtmlAttributes)
      Sets the HTML attributes rendered only on the badge label.
      Parameters:
      labelHtmlAttributes - the label HTML attributes
      Returns:
      this badge item
      Since:
      jcms-11.0.1
    • getUrl

      public String getUrl(Locale userLocale)
    • url

      public BadgeItem url(String url)
    • getHtmlTag

      public String getHtmlTag(Locale userLocale)
    • getLabelTag

      public String getLabelTag(Locale userLocale)
    • htmlTag

      public BadgeItem htmlTag(String htmlTag)
    • getIcon

      public String getIcon()
    • icon

      public BadgeItem icon(String icon)
    • getData

      public Data getData()
    • data

      public BadgeItem data(Data data)
    • rightButton

      public BadgeItem rightButton(Button rightButton)
    • isRemoveLink

      public boolean isRemoveLink()
    • removeLink

      public BadgeItem removeLink()
    • removeLink

      public BadgeItem removeLink(boolean removeLink)
    • getRightButton

      public Button getRightButton()
    • tooltip

      public BadgeItem tooltip(String tooltip)
    • getTooltip

      public String getTooltip()
    • tooltipAlt

      public BadgeItem tooltipAlt(String tooltipAlt)
      Sets the tooltip icon alternative text (literal text or language property).
      Parameters:
      tooltipAlt - the alternative text
      Returns:
      this badge item
    • getTooltipAlt

      public String getTooltipAlt(String userLang)
      Returns the tooltip icon alternative text, defaulting to more information about the badge label.
      Parameters:
      userLang - the language used to resolve the alternative text and badge label
      Returns:
      the localized alternative text
    • appendHtml

      public BadgeItem appendHtml(String appendHtml)
    • getAppendHtml

      public String getAppendHtml()
    • title

      public BadgeItem title(String title)
    • getTitle

      public String getTitle(String userLang)