Class AlertViewElement

java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
com.foreach.across.modules.bootstrapui.elements.AlertViewElement
All Implemented Interfaces:
com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement, com.foreach.across.modules.web.ui.elements.HtmlViewElement, com.foreach.across.modules.web.ui.MutableViewElement, com.foreach.across.modules.web.ui.ViewElement

public class AlertViewElement extends com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
Represents a Bootstrap alert.
Since:
1.0.0
Author:
Arne Vandamme
  • Field Details

  • Constructor Details

    • AlertViewElement

      public AlertViewElement()
  • Method Details

    • setStyle

      public AlertViewElement setStyle(Style style)
    • setDismissible

      public AlertViewElement setDismissible(boolean dismissible)
      Should the alert be dismissible or not? If so a button will be added.
      Parameters:
      dismissible - should the button be added
    • isDismissible

      public boolean isDismissible()
    • hasChildren

      public boolean hasChildren()
      Overrides:
      hasChildren in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • getChildren

      public List<com.foreach.across.modules.web.ui.ViewElement> getChildren()
      Overrides:
      getChildren in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setTagName

      protected AlertViewElement setTagName(String tagName)
      Overrides:
      setTagName in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setHtmlId

      public AlertViewElement setHtmlId(String htmlId)
      Specified by:
      setHtmlId in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setHtmlId in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • addCssClass

      public AlertViewElement addCssClass(String... cssClass)
      Specified by:
      addCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addCssClass in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • removeCssClass

      public AlertViewElement removeCssClass(String... cssClass)
      Specified by:
      removeCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeCssClass in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setAttributes

      public AlertViewElement setAttributes(Map<String,Object> attributes)
      Specified by:
      setAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttributes in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setAttribute

      public AlertViewElement setAttribute(String attributeName, Object attributeValue)
      Specified by:
      setAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttribute in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • addAttributes

      public AlertViewElement addAttributes(Map<String,Object> attributes)
      Specified by:
      addAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addAttributes in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • removeAttribute

      public AlertViewElement removeAttribute(String attributeName)
      Specified by:
      removeAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeAttribute in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setName

      public AlertViewElement setName(String name)
      Specified by:
      setName in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setName in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setCustomTemplate

      public AlertViewElement setCustomTemplate(String customTemplate)
      Specified by:
      setCustomTemplate in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setCustomTemplate in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setElementType

      protected AlertViewElement setElementType(String elementType)
      Overrides:
      setElementType in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • addChild

      public AlertViewElement addChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addChild in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • addChildren

      public AlertViewElement addChildren(Collection<? extends com.foreach.across.modules.web.ui.ViewElement> elements)
      Overrides:
      addChildren in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • addFirstChild

      public AlertViewElement addFirstChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addFirstChild in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • clearChildren

      public AlertViewElement clearChildren()
      Overrides:
      clearChildren in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • apply

      public AlertViewElement apply(Consumer<com.foreach.across.modules.web.ui.elements.ContainerViewElement> consumer)
      Overrides:
      apply in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • applyUnsafe

      public <U extends com.foreach.across.modules.web.ui.ViewElement> AlertViewElement applyUnsafe(Consumer<U> consumer)
      Overrides:
      applyUnsafe in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • setText

      public AlertViewElement setText(String text)
      Specified by:
      setText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
      Overrides:
      setText in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • set

      public AlertViewElement set(com.foreach.across.modules.web.ui.ViewElement.WitherSetter... setters)
      Specified by:
      set in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      set in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • remove

      public AlertViewElement remove(com.foreach.across.modules.web.ui.ViewElement.WitherRemover... functions)
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      remove in class com.foreach.across.modules.web.ui.elements.AbstractTextNodeViewElement
    • getCloseLabel

      public String getCloseLabel()
      Set the label for the close button if the alert is dismissible.
    • setCloseLabel

      public AlertViewElement setCloseLabel(String closeLabel)
      Set the label for the close button if the alert is dismissible.
      Returns:
      this.
    • getStyle

      public Style getStyle()