Class AbstractVoidNodeViewElement
java.lang.Object
com.foreach.across.modules.web.ui.ViewElementSupport
com.foreach.across.modules.web.ui.elements.AbstractVoidNodeViewElement
- All Implemented Interfaces:
HtmlViewElement
,MutableViewElement
,ViewElement
- Direct Known Subclasses:
VoidNodeViewElement
public abstract class AbstractVoidNodeViewElement
extends ViewElementSupport
implements HtmlViewElement
Base class for a single configurable node that supports attributes but no child nodes.
- Author:
- Arne Vandamme
- See Also:
-
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> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributes
(Map<String, Object> attributes) addCssClass
(String... cssClass) <U> U
get
(ViewElement.WitherGetter<?, U> function) Get a value from the element.getAttribute
(String attributeName) <V,
U extends V>
UgetAttribute
(String attributeName, Class<V> expectedType) @NonNull String
boolean
hasAttribute
(String attributeName) boolean
hasCssClass
(String cssClass) remove
(ViewElement.WitherRemover... functions) Execute one or more remover functions.removeAttribute
(String attributeName) removeCssClass
(String... cssClass) protected <V,
U extends V>
UreturnIfType
(Object value, Class<V> elementType) 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 AbstractVoidNodeViewElement
setElementType
(String elementType) protected AbstractVoidNodeViewElement
setTagName
(@NonNull String tagName) Methods inherited from class com.foreach.across.modules.web.ui.ViewElementSupport
getCustomTemplate, getElementType, getName
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
getCustomTemplate, getElementType, getName, matches
-
Constructor Details
-
AbstractVoidNodeViewElement
-
-
Method Details
-
addCssClass
- Specified by:
addCssClass
in interfaceHtmlViewElement
-
hasCssClass
- Specified by:
hasCssClass
in interfaceHtmlViewElement
-
removeCssClass
- Specified by:
removeCssClass
in interfaceHtmlViewElement
-
getAttributes
- Specified by:
getAttributes
in interfaceHtmlViewElement
-
setAttributes
- Specified by:
setAttributes
in interfaceHtmlViewElement
-
setAttribute
- Specified by:
setAttribute
in interfaceHtmlViewElement
-
addAttributes
- Specified by:
addAttributes
in interfaceHtmlViewElement
-
removeAttribute
- Specified by:
removeAttribute
in interfaceHtmlViewElement
-
getAttribute
- Specified by:
getAttribute
in interfaceHtmlViewElement
-
getAttribute
- Specified by:
getAttribute
in interfaceHtmlViewElement
-
hasAttribute
- Specified by:
hasAttribute
in interfaceHtmlViewElement
-
setName
- Specified by:
setName
in interfaceMutableViewElement
- Overrides:
setName
in classViewElementSupport
-
setCustomTemplate
- Specified by:
setCustomTemplate
in interfaceMutableViewElement
- Overrides:
setCustomTemplate
in classViewElementSupport
-
setElementType
- Overrides:
setElementType
in classViewElementSupport
-
returnIfType
-
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 classViewElementSupport
- 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 classViewElementSupport
- Parameters:
functions
- to execute- Returns:
- self
-
get
Description copied from interface:ViewElement
Get a value from the element. UseViewElement.WitherGetter.as(Class)
for compile time typing. Note that runtime type casting execptions will occur when using the wrong type.- Specified by:
get
in interfaceViewElement
- Type Parameters:
U
- type of the expected return value- Parameters:
function
- that returns the value- Returns:
- value
-
getTagName
- Specified by:
getTagName
in interfaceHtmlViewElement
-
setTagName
- Returns:
this
.
-
getHtmlId
- Specified by:
getHtmlId
in interfaceHtmlViewElement
-
setHtmlId
- Specified by:
setHtmlId
in interfaceHtmlViewElement
- Returns:
this
.
-