public static class Style.Builder
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
Builder() |
protected |
Builder(@NonNull Component component) |
protected |
Builder(@NonNull Style style) |
| Modifier and Type | Method and Description |
|---|---|
@NonNull Style |
build()
Builds the style.
|
@NonNull Style.Builder |
clickEvent(@Nullable ClickEvent event)
Sets the click event.
|
@NonNull Style.Builder |
color(@Nullable TextColor color)
Sets the color.
|
@NonNull Style.Builder |
colorIfAbsent(@Nullable TextColor color)
Sets the color if there isn't one set already.
|
@NonNull Style.Builder |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this style.
|
@NonNull Style.Builder |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration.
|
@NonNull Style.Builder |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event.
|
@NonNull Style.Builder |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted.
|
protected Builder()
protected Builder(@NonNull Component component)
protected Builder(@NonNull Style style)
public @NonNull Style.Builder color(@Nullable TextColor color)
color - the colorpublic @NonNull Style.Builder colorIfAbsent(@Nullable TextColor color)
color - the colorpublic @NonNull Style.Builder decoration(@NonNull TextDecoration decoration, boolean flag)
decoration - the decorationflag - true if this style should have the decoration, false if
this style should not have the decorationpublic @NonNull Style.Builder decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
decoration - the decorationstate - TextDecoration.State.TRUE if this component should have the
decoration, TextDecoration.State.FALSE if this component should not
have the decoration, and TextDecoration.State.NOT_SET if the decoration
should not have a set valuepublic @NonNull Style.Builder clickEvent(@Nullable ClickEvent event)
event - the click eventpublic @NonNull Style.Builder hoverEvent(@Nullable HoverEvent event)
event - the hover eventpublic @NonNull Style.Builder insertion(@Nullable java.lang.String insertion)
insertion - the insertion stringpublic @NonNull Style build()