Class AbstractTextNodeViewElement
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
- All Implemented Interfaces:
ConfigurableTextViewElement
,HtmlViewElement
,MutableViewElement
,ViewElement
public abstract class AbstractTextNodeViewElement
extends AbstractNodeViewElement
implements ConfigurableTextViewElement
Base class that extends
AbstractNodeViewElement
with the ConfigurableTextViewElement
.
If setText(String)
is set, a TextViewElement
will be added.- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
HtmlViewElement.Functions
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement
MutableViewElement.Functions
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElement
ViewElement.Wither<T extends ViewElement>, ViewElement.WitherGetter<T extends ViewElement,
U>, ViewElement.WitherRemover<T extends ViewElement>, ViewElement.WitherSetter<T extends 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
(@NonNull ViewElement element) Add a child to this container.addChildren
(@NonNull Collection<? extends ViewElement> elements) Add a collection of children to this container.addCssClass
(String... cssClass) addFirstChild
(@NonNull ViewElement element) Adds a child as the first one to this container.apply
(@NonNull Consumer<ContainerViewElement> consumer) Apply a consumer to this container.<U extends ViewElement>
AbstractTextNodeViewElementapplyUnsafe
(@NonNull Consumer<U> consumer) Apply a consumer to this container.Remove all children from this container.Get the list of direct children this container represents.getText()
Configure a simple text body for the alert.boolean
remove
(ViewElement.WitherRemover... functions) Execute one or more remover functions.removeAttribute
(String attributeName) removeCssClass
(String... cssClass) set
(ViewElement.WitherSetter... setters) Execute one or more setter functions.setAttribute
(String attributeName, Object attributeValue) setAttributes
(@NonNull Map<String, Object> attributes) setCustomTemplate
(String customTemplate) protected AbstractTextNodeViewElement
setElementType
(String elementType) protected AbstractTextNodeViewElement
setTagName
(@NonNull String tagName) Configure a simple text body for the alert.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.ViewElement
get, getCustomTemplate, getElementType, getName, matches
-
Constructor Details
-
AbstractTextNodeViewElement
-
-
Method Details
-
setTagName
- Overrides:
setTagName
in classAbstractNodeViewElement
- Returns:
this
.
-
setHtmlId
- Specified by:
setHtmlId
in interfaceHtmlViewElement
- Overrides:
setHtmlId
in classAbstractNodeViewElement
- Returns:
this
.
-
addCssClass
- Specified by:
addCssClass
in interfaceHtmlViewElement
- Overrides:
addCssClass
in classAbstractNodeViewElement
-
removeCssClass
- Specified by:
removeCssClass
in interfaceHtmlViewElement
- Overrides:
removeCssClass
in classAbstractNodeViewElement
-
setAttributes
- Specified by:
setAttributes
in interfaceHtmlViewElement
- Overrides:
setAttributes
in classAbstractNodeViewElement
-
setAttribute
- Specified by:
setAttribute
in interfaceHtmlViewElement
- Overrides:
setAttribute
in classAbstractNodeViewElement
-
addAttributes
- Specified by:
addAttributes
in interfaceHtmlViewElement
- Overrides:
addAttributes
in classAbstractNodeViewElement
-
removeAttribute
- Specified by:
removeAttribute
in interfaceHtmlViewElement
- Overrides:
removeAttribute
in classAbstractNodeViewElement
-
setName
- Specified by:
setName
in interfaceMutableViewElement
- Overrides:
setName
in classAbstractNodeViewElement
- Returns:
this
.
-
setCustomTemplate
- Specified by:
setCustomTemplate
in interfaceMutableViewElement
- Overrides:
setCustomTemplate
in classAbstractNodeViewElement
- Returns:
this
.
-
setElementType
- Overrides:
setElementType
in classAbstractNodeViewElement
- Returns:
this
.
-
addChild
Description copied from class:ContainerViewElement
Add a child to this container.- Overrides:
addChild
in classAbstractNodeViewElement
- Parameters:
element
- to add
-
addChildren
public AbstractTextNodeViewElement addChildren(@NonNull @NonNull Collection<? extends ViewElement> elements) Description copied from class:ContainerViewElement
Add a collection of children to this container.- Overrides:
addChildren
in classAbstractNodeViewElement
- Parameters:
elements
- to add
-
addFirstChild
Description copied from class:ContainerViewElement
Adds a child as the first one to this container.- Overrides:
addFirstChild
in classAbstractNodeViewElement
- Parameters:
element
- to add
-
clearChildren
Description copied from class:ContainerViewElement
Remove all children from this container.- Overrides:
clearChildren
in classAbstractNodeViewElement
-
apply
Description copied from class:ContainerViewElement
Apply a consumer to this container. Useful for providing extensions that wish to provide actions on the container itself.- Overrides:
apply
in classAbstractNodeViewElement
- Parameters:
consumer
- to execute
-
applyUnsafe
public <U extends ViewElement> AbstractTextNodeViewElement applyUnsafe(@NonNull @NonNull Consumer<U> consumer) Description copied from class:ContainerViewElement
Apply a consumer to this container. Useful for providing extensions that wish to provide actions on the container itself. This method allows you to pass anyConsumer
for a genericViewElement
. Note that if you pass a consumer for a type that is not compatible withContainerViewElement
, you will receive class cast exceptions at runtime, hence the unsafe.- Overrides:
applyUnsafe
in classAbstractNodeViewElement
- Parameters:
consumer
- to execute
-
hasChildren
public boolean hasChildren()- Overrides:
hasChildren
in classContainerViewElement
- Returns:
- true if this container has child elements
-
getChildren
Description copied from class:ContainerViewElement
Get the list of direct children this container represents.- Overrides:
getChildren
in classContainerViewElement
- Returns:
- list of child elements this container represents
-
set
Description copied from interface:ViewElement
Execute one or more setter functions.- Specified by:
set
in interfaceHtmlViewElement
- Specified by:
set
in interfaceMutableViewElement
- Specified by:
set
in interfaceViewElement
- Overrides:
set
in classAbstractNodeViewElement
- Parameters:
setters
- to execute- Returns:
- self
-
remove
Description copied from interface:ViewElement
Execute one or more remover functions. A remover is defined as a separate interface so implementations can both implement setter and remover at the same time.- Specified by:
remove
in interfaceHtmlViewElement
- Specified by:
remove
in interfaceMutableViewElement
- Specified by:
remove
in interfaceViewElement
- Overrides:
remove
in classAbstractNodeViewElement
- Parameters:
functions
- to execute- Returns:
- self
-
getText
Configure a simple text body for the alert. Additional children will be after.- Specified by:
getText
in interfaceConfigurableTextViewElement
-
setText
Configure a simple text body for the alert. Additional children will be after.- Specified by:
setText
in interfaceConfigurableTextViewElement
- Returns:
this
.
-