Package com.storedobject.common
Interface StyledBuilder
- All Known Subinterfaces:
GridCellText
,StyledBuilder
- All Known Implementing Classes:
Alert
,CSVUploadProcessorView
,ELabel
,ELabelField
,ELabels
,ErrorText
,ExcelDataUpload
,HTMLText
,HTMLText
,PDF.Text
,ProcessView
,StyledString
,StyledString
,TextView
,TransactionControl
,UploadProcessorView
,ZipUploadProcessorView
public interface StyledBuilder
Build something with "styles".
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
Representation of HTML style. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAppend an object.default StyledBuilder
append
(Object object, StyledBuilder.Style... styles) Append an object with the given style.default StyledBuilder
Append an object with the given color.default StyledBuilder
Append an object with the given style.static void
apply
(String styles, Consumer<StyledBuilder.Style> element) Apply styles to a consumer.Clear the content.boolean
isEmpty()
Check if the content is empty or not.boolean
Check if the last add was a new line or not.default StyledBuilder
newLine()
Adds a new line.newLine
(boolean forceIt) Adds a new line.default void
Set a value.default void
setValue
(Object object, StyledBuilder.Style... styles) Set a value with the given styles.default void
Set a value with the given styles.default StyledBuilder
update()
Update internals if required.
-
Field Details
-
EMPTY_STRINGS
-
-
Method Details
-
append
Append an object.- Parameters:
object
- Object to append.- Returns:
- Self-reference is returned.
-
append
Append an object with the given color.- Parameters:
object
- Object to append.color
- Color to be set. (Default implementation ignores this).- Returns:
- Self-reference is returned.
-
setValue
Set a value. (Previous content if any will be cleared).- Parameters:
object
- Object (value) to set.
-
setValue
-
setValue
Set a value with the given styles. (Previous content if any will be cleared).- Parameters:
object
- Object (value) to set.styles
- Styles to be set.
-
append
Append an object with the given style.- Parameters:
object
- Object to append.styles
- Styles to be set. (Default implementation ignores this).- Returns:
- Self-reference is returned.
-
append
Append an object with the given style. Default implementation ignores styles.- Parameters:
object
- Object to append.styles
- Styles to be set.- Returns:
- Self-reference is returned.
-
isEmpty
boolean isEmpty()Check if the content is empty or not.- Returns:
- True or false.
-
newLine
Adds a new line. (Default implementation doesn't force a new line).- Returns:
- Self-reference is returned.
-
newLine
Adds a new line.- Parameters:
forceIt
- If true, a new line is added anyway. Otherwise, no new line should be added ifisNewLine()
returns false.- Returns:
- Self-reference is returned.
-
isNewLine
boolean isNewLine()Check if the last add was a new line or not.- Returns:
- True/false
-
update
Update internals if required. (Default implementation does nothing).- Returns:
- Self-reference is returned.
-
clearContent
-
apply
Apply styles to a consumer.- Parameters:
styles
- Styles text. It will be parsed create styles.element
- Element that accepts the styles.
-