Class TextViewElement
java.lang.Object
com.foreach.across.modules.web.ui.ViewElementSupport
com.foreach.across.modules.web.ui.elements.TextViewElement
- All Implemented Interfaces:
ConfigurableTextViewElement
,MutableViewElement
,ViewElement
,ViewElement.WitherSetter<ViewElement>
public class TextViewElement
extends ViewElementSupport
implements ConfigurableTextViewElement, ViewElement.WitherSetter<ViewElement>
A simple text item.
-
Nested Class Summary
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
-
Constructor Summary
ConstructorDescriptionTextViewElement
(String text) TextViewElement
(String text, boolean escapeXml) TextViewElement
(String name, String text) TextViewElement
(String name, String text, boolean escapeXml) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyTo
(ViewElement target) If the target implementsConfigurableTextViewElement
then the text property will be copied.getText()
static TextViewElement
Alias toxml(String)
.boolean
remove
(ViewElement.WitherRemover... functions) Execute one or more remover functions.set
(ViewElement.WitherSetter... setters) Execute one or more setter functions.setCustomTemplate
(String customTemplate) setEscapeXml
(boolean escapeXml) static TextViewElement
Factory method to create aTextViewElement
for plain xml-escaped text.static TextViewElement
Factory method to create aTextViewElement
for XML content (non-escaped).Methods inherited from class com.foreach.across.modules.web.ui.ViewElementSupport
getCustomTemplate, getElementType, getName, setElementType
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
-
Field Details
-
ELEMENT_TYPE
- See Also:
-
-
Constructor Details
-
TextViewElement
public TextViewElement() -
TextViewElement
-
TextViewElement
-
TextViewElement
-
TextViewElement
-
-
Method Details
-
setName
- Specified by:
setName
in interfaceMutableViewElement
- Overrides:
setName
in classViewElementSupport
-
setCustomTemplate
- Specified by:
setCustomTemplate
in interfaceMutableViewElement
- Overrides:
setCustomTemplate
in classViewElementSupport
-
set
Description copied from interface:ViewElement
Execute one or more setter functions.- 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 interfaceMutableViewElement
- Specified by:
remove
in interfaceViewElement
- Overrides:
remove
in classViewElementSupport
- Parameters:
functions
- to execute- Returns:
- self
-
applyTo
If the target implementsConfigurableTextViewElement
then the text property will be copied. Else if the target is aContainerViewElement
the element itself will be added as the first child.- Specified by:
applyTo
in interfaceViewElement.WitherSetter<ViewElement>
-
text
Factory method to create aTextViewElement
for plain xml-escaped text.- Parameters:
text
- content- Returns:
- element
-
html
Alias toxml(String)
.- Parameters:
html
- content- Returns:
- element
-
xml
Factory method to create aTextViewElement
for XML content (non-escaped).- Parameters:
xml
- content- Returns:
- element
-
isEscapeXml
public boolean isEscapeXml() -
getText
- Specified by:
getText
in interfaceConfigurableTextViewElement
-
setEscapeXml
- Returns:
this
.
-
setText
- Specified by:
setText
in interfaceConfigurableTextViewElement
- Returns:
this
.
-