Class InputGroupFormElement

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.InputGroupFormElement
All Implemented Interfaces:
ConfigurablePlaceholderText, FormControlElement, FormControlElement.Proxy, FormInputElement, 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:
DateTimeFormElement

public class InputGroupFormElement extends com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement implements FormControlElement.Proxy, ConfigurablePlaceholderText

Represents a bootstrap input group, wrapping a control and allowing left or right addon. The main control should be added as a child to the input group, the addons can be set through properties and the corresponding addon class (input-group-addon of input-group-btn will be set.

A default TextboxFormElement control is set for the input group as input groups are usually expected to be used with textboxes. The InputGroupFormElement itself is also a FormControlElement that proxies the control. If the control is not of type FormControlElement the specific FormControlElement method calls will fail.

Author:
Arne Vandamme
  • Constructor Details

    • InputGroupFormElement

      public InputGroupFormElement()
  • Method Details

    • getPrepend

      public <V extends com.foreach.across.modules.web.ui.ViewElement> V getPrepend(Class<V> addonType)
    • getAppend

      public <V extends com.foreach.across.modules.web.ui.ViewElement> V getAppend(Class<V> addonType)
    • setPlaceholder

      public InputGroupFormElement setPlaceholder(String placeholder)
      Specified by:
      setPlaceholder in interface ConfigurablePlaceholderText
    • getPlaceholder

      public String getPlaceholder()
      Specified by:
      getPlaceholder in interface ConfigurablePlaceholderText
    • getControl

      public <V extends com.foreach.across.modules.web.ui.ViewElement> V getControl(Class<V> controlType)
    • isDisabled

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

      public InputGroupFormElement setDisabled(boolean disabled)
      Specified by:
      setDisabled in interface FormInputElement
    • isReadonly

      public boolean isReadonly()
      Specified by:
      isReadonly in interface FormControlElement
    • setReadonly

      public InputGroupFormElement setReadonly(boolean readonly)
      Specified by:
      setReadonly in interface FormControlElement
    • isRequired

      public boolean isRequired()
      Specified by:
      isRequired in interface FormControlElement
    • setRequired

      public InputGroupFormElement setRequired(boolean required)
      Specified by:
      setRequired in interface FormControlElement
    • getControlName

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

      public InputGroupFormElement setControlName(String controlName)
      Specified by:
      setControlName in interface FormInputElement
    • getChildren

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

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

      public InputGroupFormElement 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 InputGroupFormElement 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 InputGroupFormElement 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 InputGroupFormElement 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 InputGroupFormElement 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 InputGroupFormElement 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
    • setName

      public InputGroupFormElement 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
    • setCustomTemplate

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

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

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

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

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

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

      public InputGroupFormElement 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
    • set

      public InputGroupFormElement 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 InputGroupFormElement 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
    • prepend

      public static com.foreach.across.modules.web.ui.ViewElement.WitherSetter<InputGroupFormElement> prepend(com.foreach.across.modules.web.ui.ViewElement... elements)
      Prepend a number of view elements. If a single text view element is added, it will be wrapped inside a span with class input-group-text.
    • append

      public static com.foreach.across.modules.web.ui.ViewElement.WitherSetter<InputGroupFormElement> append(com.foreach.across.modules.web.ui.ViewElement... elements)
      Append a number of view elements. If a single text view element is added, it will be wrapped inside a span with class input-group-text.
    • control

      public static com.foreach.across.modules.web.ui.ViewElement.WitherSetter<InputGroupFormElement> control(com.foreach.across.modules.web.ui.ViewElement... elements)
      Set the input group control, replacing the default textbox.
    • getPrepend

      public com.foreach.across.modules.web.ui.ViewElement getPrepend()
    • getAppend

      public com.foreach.across.modules.web.ui.ViewElement getAppend()
    • getControl

      public com.foreach.across.modules.web.ui.ViewElement getControl()
      Specified by:
      getControl in interface FormControlElement.Proxy
      Returns:
      the actual control
    • setPrepend

      public InputGroupFormElement setPrepend(com.foreach.across.modules.web.ui.ViewElement prepend)
      Returns:
      this.
    • setAppend

      public InputGroupFormElement setAppend(com.foreach.across.modules.web.ui.ViewElement append)
      Returns:
      this.
    • setControl

      public InputGroupFormElement setControl(com.foreach.across.modules.web.ui.ViewElement control)
      Returns:
      this.