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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.foreach.across.modules.bootstrapui.elements.FormControlElement
FormControlElement.Proxy
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
com.foreach.across.modules.web.ui.elements.HtmlViewElement.Functions
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement
com.foreach.across.modules.web.ui.MutableViewElement.Functions
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElement
com.foreach.across.modules.web.ui.ViewElement.Wither<T extends com.foreach.across.modules.web.ui.ViewElement>, com.foreach.across.modules.web.ui.ViewElement.WitherGetter<T extends com.foreach.across.modules.web.ui.ViewElement,
U extends Object>, com.foreach.across.modules.web.ui.ViewElement.WitherRemover<T extends com.foreach.across.modules.web.ui.ViewElement>, com.foreach.across.modules.web.ui.ViewElement.WitherSetter<T extends com.foreach.across.modules.web.ui.ViewElement> -
Field Summary
Fields inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement
ELEMENT_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributes
(Map<String, Object> attributes) addChild
(com.foreach.across.modules.web.ui.ViewElement element) addChildren
(Collection<? extends com.foreach.across.modules.web.ui.ViewElement> elements) addCssClass
(String... cssClass) addFirstChild
(com.foreach.across.modules.web.ui.ViewElement element) 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.<U extends com.foreach.across.modules.web.ui.ViewElement>
InputGroupFormElementapplyUnsafe
(Consumer<U> consumer) 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.com.foreach.across.modules.web.ui.ViewElement
<V extends com.foreach.across.modules.web.ui.ViewElement>
VList<com.foreach.across.modules.web.ui.ViewElement>
com.foreach.across.modules.web.ui.ViewElement
<V extends com.foreach.across.modules.web.ui.ViewElement>
VgetControl
(Class<V> controlType) com.foreach.across.modules.web.ui.ViewElement
<V extends com.foreach.across.modules.web.ui.ViewElement>
VgetPrepend
(Class<V> addonType) boolean
boolean
boolean
boolean
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.remove
(com.foreach.across.modules.web.ui.ViewElement.WitherRemover... functions) removeAttribute
(String attributeName) removeCssClass
(String... cssClass) set
(com.foreach.across.modules.web.ui.ViewElement.WitherSetter... setters) setAppend
(com.foreach.across.modules.web.ui.ViewElement append) setAttribute
(String attributeName, Object attributeValue) setAttributes
(Map<String, Object> attributes) setControl
(com.foreach.across.modules.web.ui.ViewElement control) setControlName
(String controlName) setCustomTemplate
(String customTemplate) setDisabled
(boolean disabled) protected InputGroupFormElement
setElementType
(String elementType) setPlaceholder
(String placeholder) setPrepend
(com.foreach.across.modules.web.ui.ViewElement prepend) setReadonly
(boolean readonly) setRequired
(boolean required) protected InputGroupFormElement
setTagName
(String tagName) Methods inherited from class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
get, getAttribute, getAttribute, getAttributes, getHtmlId, getTagName, hasAttribute, hasCssClass, returnIfType
Methods inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement
elementStream, find, find, findAll, findAll, findAll, findOrSelf, findOrSelf, flatStream, getCustomTemplate, getElementType, getName, removeAllFromTree, removeChild, removeFromTree, removeFromTree
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
getAttribute, getAttribute, getAttributes, getHtmlId, getTagName, hasAttribute, hasCssClass
Methods inherited from interface com.foreach.across.modules.web.ui.ViewElement
get, getCustomTemplate, getElementType, getName, matches
-
Constructor Details
-
InputGroupFormElement
public InputGroupFormElement()
-
-
Method Details
-
getPrepend
-
getAppend
-
setPlaceholder
- Specified by:
setPlaceholder
in interfaceConfigurablePlaceholderText
-
getPlaceholder
- Specified by:
getPlaceholder
in interfaceConfigurablePlaceholderText
-
getControl
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabled
in interfaceFormInputElement
-
setDisabled
- Specified by:
setDisabled
in interfaceFormInputElement
-
isReadonly
public boolean isReadonly()- Specified by:
isReadonly
in interfaceFormControlElement
-
setReadonly
- Specified by:
setReadonly
in interfaceFormControlElement
-
isRequired
public boolean isRequired()- Specified by:
isRequired
in interfaceFormControlElement
-
setRequired
- Specified by:
setRequired
in interfaceFormControlElement
-
getControlName
- Specified by:
getControlName
in interfaceFormInputElement
-
setControlName
- Specified by:
setControlName
in interfaceFormInputElement
-
getChildren
- Overrides:
getChildren
in classcom.foreach.across.modules.web.ui.elements.ContainerViewElement
-
hasChildren
public boolean hasChildren()- Overrides:
hasChildren
in classcom.foreach.across.modules.web.ui.elements.ContainerViewElement
-
addCssClass
- Specified by:
addCssClass
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
addCssClass
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
removeCssClass
- Specified by:
removeCssClass
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
removeCssClass
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setAttributes
- Specified by:
setAttributes
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
setAttributes
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setAttribute
- Specified by:
setAttribute
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
setAttribute
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
addAttributes
- Specified by:
addAttributes
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
addAttributes
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
removeAttribute
- Specified by:
removeAttribute
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
removeAttribute
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setName
- Specified by:
setName
in interfacecom.foreach.across.modules.web.ui.MutableViewElement
- Overrides:
setName
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setCustomTemplate
- Specified by:
setCustomTemplate
in interfacecom.foreach.across.modules.web.ui.MutableViewElement
- Overrides:
setCustomTemplate
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setElementType
- Overrides:
setElementType
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
addChild
- Overrides:
addChild
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
addChildren
public InputGroupFormElement addChildren(Collection<? extends com.foreach.across.modules.web.ui.ViewElement> elements) - Overrides:
addChildren
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
addFirstChild
- Overrides:
addFirstChild
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
clearChildren
- Overrides:
clearChildren
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
apply
public InputGroupFormElement apply(Consumer<com.foreach.across.modules.web.ui.elements.ContainerViewElement> consumer) - Overrides:
apply
in classcom.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 classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setTagName
- Overrides:
setTagName
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
setHtmlId
- Specified by:
setHtmlId
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Overrides:
setHtmlId
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
set
public InputGroupFormElement set(com.foreach.across.modules.web.ui.ViewElement.WitherSetter... setters) - Specified by:
set
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Specified by:
set
in interfacecom.foreach.across.modules.web.ui.MutableViewElement
- Specified by:
set
in interfacecom.foreach.across.modules.web.ui.ViewElement
- Overrides:
set
in classcom.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
-
remove
public InputGroupFormElement remove(com.foreach.across.modules.web.ui.ViewElement.WitherRemover... functions) - Specified by:
remove
in interfacecom.foreach.across.modules.web.ui.elements.HtmlViewElement
- Specified by:
remove
in interfacecom.foreach.across.modules.web.ui.MutableViewElement
- Specified by:
remove
in interfacecom.foreach.across.modules.web.ui.ViewElement
- Overrides:
remove
in classcom.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 interfaceFormControlElement.Proxy
- Returns:
- the actual control
-
setPrepend
- Returns:
this
.
-
setAppend
- Returns:
this
.
-
setControl
- Returns:
this
.
-