Class Button

java.lang.Object
com.jalios.jcms.uicomponent.Button
Direct Known Subclasses:
ButtonAjax, ButtonModal

public class Button extends Object
Produces the button element html
Since:
jcms-10.0.7 / JCMS-9734
  • Field Details

  • Constructor Details

    • Button

      public Button(Button.ButtonBuilder<?> builder)
      Core button class rendered as <button> or <a>. Built via a generic self-typed builder to preserve subclass types across fluent calls.
  • Method Details

    • getHtml

      public String getHtml()
    • getStartHtml

      public String getStartHtml()
    • getInnerHtml

      public String getInnerHtml()
    • getEndHtml

      public String getEndHtml()
    • getCss

      public String getCss()
    • addCss

      public Button addCss(String classes)
      Adds CSS classes to this Button.

      The classes string can contain one or more class names separated by spaces. They will be appended to the existing css field.

      Example:

      
       button.addCss("btn-primary");
       button.addCss("btn-lg rounded shadow");
       
      Parameters:
      classes - a space-separated string of CSS classes to add
      Returns:
      this Button instance (for fluent usage)
    • getLabel

      public String getLabel()
    • build

      public Button build()
    • getIcon

      public String getIcon()
    • getIconSuffix

      public String getIconSuffix()
    • getIconAlt

      public String getIconAlt()
    • getButtonType

      public Button.ButtonType getButtonType()
    • isConfirm

      public boolean isConfirm()
    • getConfirmText

      public String getConfirmText()
    • getConfirmAttributes

      public ConfirmAttributes getConfirmAttributes()
    • getDataAttribute

      public DataAttribute getDataAttribute()
    • addDataAttribute

      public Button addDataAttribute(DataAttribute attribute)
    • getHtmlAttributes

      public String getHtmlAttributes()
    • getButtonContent

      public String getButtonContent()
    • getUrl

      public String getUrl()
    • getTitle

      public String getTitle()
    • addUrlAsHref

      public boolean addUrlAsHref()
    • getName

      public String getName()
    • getValue

      public String getValue()
    • translate

      public void translate(String userLang)
      Translates the button (If provided programmatically using a provided Button on ButtonTag)
      Parameters:
      userLang - the User language