Interface TextStyle
- All Superinterfaces:
Buildable<TextStyle,TextStyle.Builder>
Represents the styling of the text contained in a component.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA text style builder.static interfaceTextStyle.Setter<T extends TextStyle.Setter<T>>Represents an object that can set text style properties. -
Method Summary
Modifier and TypeMethodDescriptionstatic TextStyle.Builderbuilder()Creates a new text style builder.@Nullable ComponentColorReturns the background color of this style.Returns the decorations of this style.@Nullable ComponentColorReturns the text color of this style.default TextStyleMerges this text style with another one, overriding existing values.static TextStylenone()Returns a text style with no styling.static TextStyleof(@Nullable ComponentColor textColor) Creates a new text style with the given text color.static TextStyleof(@Nullable ComponentColor textColor, @Nullable ComponentColor backColor) Creates a new text style with the given colors.static TextStyleof(@Nullable ComponentColor textColor, @Nullable ComponentColor backColor, Map<TextDecoration, Boolean> decorations) Creates a new text style with the given colors and decorations.static TextStyleof(@Nullable ComponentColor textColor, TextDecoration... decorations) Creates a new text style with the given text color and decorations.static TextStyleof(TextDecoration... decorations) Creates a new text style with the given decorations.static TextStyleof(Map<TextDecoration, Boolean> decorations) Creates a new text style with the given decorations.default TextStyle.Builder
-
Method Details
-
of
static TextStyle of(@Nullable ComponentColor textColor, @Nullable ComponentColor backColor, Map<TextDecoration, Boolean> decorations) Creates a new text style with the given colors and decorations.- Parameters:
textColor- the text colorbackColor- the background colordecorations- the decorations- Returns:
- the text style
-
of
Creates a new text style with the given colors.- Parameters:
textColor- the text colorbackColor- the background color- Returns:
- the text style
-
of
Creates a new text style with the given text color.- Parameters:
textColor- the text color- Returns:
- the text style
-
of
Creates a new text style with the given text color and decorations.- Parameters:
decorations- the decorations- Returns:
- the text style
-
of
Creates a new text style with the given decorations.- Parameters:
decorations- the decorations- Returns:
- the text style
-
of
Creates a new text style with the given decorations.- Parameters:
decorations- the decorations- Returns:
- the text style
-
none
Returns a text style with no styling. -
builder
Creates a new text style builder. -
getTextColor
@Nullable ComponentColor getTextColor()Returns the text color of this style. -
getBackColor
@Nullable ComponentColor getBackColor()Returns the background color of this style. -
getDecorations
Map<TextDecoration,Boolean> getDecorations()Returns the decorations of this style. -
merge
Merges this text style with another one, overriding existing values.- Parameters:
other- the style to merge- Returns:
- the merged text style
-
toBuilder
- Specified by:
toBuilderin interfaceBuildable<TextStyle,TextStyle.Builder>
-