Class CheckboxFormElement

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.FormControlElementSupport
com.foreach.across.modules.bootstrapui.elements.CheckboxFormElement
All Implemented Interfaces:
FormControlElement, 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
Direct Known Subclasses:
RadioFormElement, ToggleFormElement

public class CheckboxFormElement extends FormControlElementSupport implements com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
Represents a HTML checkbox element.
Author:
Arne Vandamme
  • Field Details

  • Constructor Details

    • CheckboxFormElement

      public CheckboxFormElement()
  • Method Details

    • getText

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

      public CheckboxFormElement setText(String label)
      Specified by:
      setText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
    • setDisabled

      public CheckboxFormElement setDisabled(boolean disabled)
      Specified by:
      setDisabled in interface FormInputElement
      Overrides:
      setDisabled in class FormControlElementSupport
      Returns:
      this.
    • setReadonly

      public CheckboxFormElement setReadonly(boolean readonly)
      Specified by:
      setReadonly in interface FormControlElement
      Overrides:
      setReadonly in class FormControlElementSupport
      Returns:
      this.
    • setRequired

      public CheckboxFormElement setRequired(boolean required)
      Specified by:
      setRequired in interface FormControlElement
      Overrides:
      setRequired in class FormControlElementSupport
      Returns:
      this.
    • setName

      public CheckboxFormElement setName(String name)
      Specified by:
      setName in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setName in class FormControlElementSupport
    • setControlName

      public CheckboxFormElement setControlName(String controlName)
      Specified by:
      setControlName in interface FormInputElement
      Overrides:
      setControlName in class FormControlElementSupport
    • setHtmlId

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

      public CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement 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 CheckboxFormElement setElementType(String elementType)
      Overrides:
      setElementType in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • addChild

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

      public CheckboxFormElement 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 CheckboxFormElement addFirstChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addFirstChild in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • clearChildren

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

      public CheckboxFormElement 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> CheckboxFormElement applyUnsafe(Consumer<U> consumer)
      Overrides:
      applyUnsafe in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setTagName

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

      public CheckboxFormElement 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 CheckboxFormElement 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
    • isChecked

      public boolean isChecked()
    • isWrapped

      public boolean isWrapped()
    • isRenderAsCustomControl

      public boolean isRenderAsCustomControl()
      Should the control be rendered as a bootstrap custom control (default) or as a browser default form control.
    • getValue

      public Object getValue()
    • setChecked

      public CheckboxFormElement setChecked(boolean checked)
      Returns:
      this.
    • setWrapped

      public CheckboxFormElement setWrapped(boolean wrapped)
      Returns:
      this.
    • setRenderAsCustomControl

      public CheckboxFormElement setRenderAsCustomControl(boolean renderAsCustomControl)
      Should the control be rendered as a bootstrap custom control (default) or as a browser default form control.
      Returns:
      this.
    • setValue

      public CheckboxFormElement setValue(Object value)
      Returns:
      this.