Class ButtonViewElement

java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
com.foreach.across.modules.bootstrapui.elements.ButtonViewElement
All Implemented Interfaces:
FormInputElement, 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 ButtonViewElement extends com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement implements com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement, FormInputElement
Represents a Bootstrap button.
Author:
Arne Vandamme
  • Field Details

  • Constructor Details

    • ButtonViewElement

      public ButtonViewElement()
  • Method Details

    • setStyle

      public ButtonViewElement setStyle(Style style)
    • setSize

      @Deprecated public ButtonViewElement setSize(Size newSize)
      Deprecated.
    • setName

      public ButtonViewElement 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.AbstractNodeViewElement
    • getControlName

      public String getControlName()
      Specified by:
      getControlName in interface FormInputElement
    • setControlName

      public ButtonViewElement setControlName(String controlName)
      Specified by:
      setControlName in interface FormInputElement
    • setHtmlId

      public ButtonViewElement 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.AbstractNodeViewElement
    • isDisabled

      public boolean isDisabled()
      Specified by:
      isDisabled in interface FormInputElement
    • setDisabled

      public ButtonViewElement setDisabled(boolean disabled)
      Specified by:
      setDisabled in interface FormInputElement
    • addCssClass

      public ButtonViewElement 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.AbstractNodeViewElement
    • removeCssClass

      public ButtonViewElement 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.AbstractNodeViewElement
    • setAttributes

      public ButtonViewElement 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.AbstractNodeViewElement
    • setAttribute

      public ButtonViewElement 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.AbstractNodeViewElement
    • addAttributes

      public ButtonViewElement 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.AbstractNodeViewElement
    • removeAttribute

      public ButtonViewElement 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.AbstractNodeViewElement
    • setCustomTemplate

      public ButtonViewElement 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.AbstractNodeViewElement
    • setElementType

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

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

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

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

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

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

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

      protected ButtonViewElement setTagName(String tagName)
      Overrides:
      setTagName in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • set

      public ButtonViewElement 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.AbstractNodeViewElement
    • remove

      public ButtonViewElement 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.AbstractNodeViewElement
    • getText

      public String getText()
      Specified by:
      getText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
    • getTitle

      public String getTitle()
    • getUrl

      public String getUrl()
    • getStyle

      public Style getStyle()
    • getStyleRule

      public BootstrapStyleRule getStyleRule()
    • getType

      @NonNull public @NonNull ButtonViewElement.Type getType()
    • getState

      public ButtonViewElement.State getState()
    • getSize

      @Deprecated public Size getSize()
      Deprecated.
    • getIcon

      public com.foreach.across.modules.web.ui.ViewElement getIcon()
      Set the icon to be aligned on the left-hand side of the text (if there is any text).
    • getValue

      public String getValue()
    • setText

      public ButtonViewElement setText(String text)
      Specified by:
      setText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
      Returns:
      this.
    • setTitle

      public ButtonViewElement setTitle(String title)
      Returns:
      this.
    • setUrl

      public ButtonViewElement setUrl(String url)
      Returns:
      this.
    • setStyleRule

      public ButtonViewElement setStyleRule(BootstrapStyleRule styleRule)
      Returns:
      this.
    • setType

      public ButtonViewElement setType(@NonNull @NonNull ButtonViewElement.Type type)
      Returns:
      this.
    • setState

      public ButtonViewElement setState(ButtonViewElement.State state)
      Returns:
      this.
    • setIcon

      public ButtonViewElement setIcon(com.foreach.across.modules.web.ui.ViewElement icon)
      Set the icon to be aligned on the left-hand side of the text (if there is any text).
      Returns:
      this.
    • setValue

      public ButtonViewElement setValue(String value)
      Returns:
      this.