public class SelectorComponent extends AbstractBuildableComponent<SelectorComponent,SelectorComponent.Builder>
| Modifier and Type | Class and Description |
|---|---|
static class |
SelectorComponent.Builder
A selector component builder.
|
AbstractBuildableComponent.AbstractBuilder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>bold, children, clickEvent, color, hoverEvent, insertion, italic, obfuscated, strikethrough, underlinedEMPTY_COMPONENT_LIST| Modifier | Constructor and Description |
|---|---|
protected |
SelectorComponent(@NonNull java.util.List<Component> children,
@Nullable TextColor color,
TextDecoration.State obfuscated,
TextDecoration.State bold,
TextDecoration.State strikethrough,
TextDecoration.State underlined,
TextDecoration.State italic,
@Nullable ClickEvent clickEvent,
@Nullable HoverEvent hoverEvent,
@Nullable java.lang.String insertion,
@NonNull java.lang.String pattern) |
protected |
SelectorComponent(@NonNull SelectorComponent.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
@NonNull SelectorComponent |
append(@NonNull Component component)
Appends a component to this component.
|
static SelectorComponent.Builder |
builder()
Creates a selector component builder.
|
static SelectorComponent.Builder |
builder(@NonNull java.lang.String pattern)
Creates a selector component builder with a pattern.
|
@NonNull SelectorComponent |
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.
|
@NonNull SelectorComponent |
color(@Nullable TextColor color)
Sets the color of this component.
|
@NonNull SelectorComponent |
copy()
Creates a component.
|
@NonNull SelectorComponent |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this component.
|
@NonNull SelectorComponent |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
@NonNull SelectorComponent |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event of this component.
|
@NonNull SelectorComponent |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted when this component is shift-clicked.
|
@NonNull SelectorComponent |
mergeColor(@NonNull Component that)
Merges the color from another component into this component.
|
@NonNull SelectorComponent |
mergeDecorations(@NonNull Component that)
Merges the decorations from another component into this component.
|
@NonNull SelectorComponent |
mergeEvents(@NonNull Component that)
Merges the events from another component into this component.
|
@NonNull SelectorComponent |
mergeStyle(@NonNull Component that)
Merges styling from another component into this component.
|
static SelectorComponent |
of(@NonNull java.lang.String pattern)
Creates a selector component with a pattern.
|
@NonNull java.lang.String |
pattern()
Gets the selector pattern.
|
@NonNull SelectorComponent |
pattern(@NonNull java.lang.String pattern)
Sets the selector pattern.
|
protected void |
populateToString(com.google.common.base.MoreObjects.ToStringHelper builder) |
@NonNull SelectorComponent |
resetStyle()
Resets all styling on this component.
|
@NonNull SelectorComponent.Builder |
toBuilder()
Create a builder from this component.
|
children, clickEvent, color, decoration, equals, hasStyling, hoverEvent, insertion, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitchildren, clickEvent, color, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, of, of, of, of, of, ofprotected SelectorComponent(@NonNull SelectorComponent.Builder builder)
protected SelectorComponent(@NonNull java.util.List<Component> children, @Nullable TextColor color, TextDecoration.State obfuscated, TextDecoration.State bold, TextDecoration.State strikethrough, TextDecoration.State underlined, TextDecoration.State italic, @Nullable ClickEvent clickEvent, @Nullable HoverEvent hoverEvent, @Nullable java.lang.String insertion, @NonNull java.lang.String pattern)
public static SelectorComponent.Builder builder()
public static SelectorComponent.Builder builder(@NonNull java.lang.String pattern)
pattern - the selector patternpublic static SelectorComponent of(@NonNull java.lang.String pattern)
pattern - the selector patternpublic @NonNull java.lang.String pattern()
public @NonNull SelectorComponent pattern(@NonNull java.lang.String pattern)
pattern - the selector patternpublic @NonNull SelectorComponent append(@NonNull Component component)
Componentcomponent - the component to appendpublic @NonNull SelectorComponent color(@Nullable TextColor color)
Componentcolor - the colorpublic @NonNull SelectorComponent decoration(@NonNull TextDecoration decoration, boolean flag)
Componentdecoration - the decorationflag - true if this component should have the decoration, false if
this component should not have the decorationpublic @NonNull SelectorComponent decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
Componentdecoration - 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 SelectorComponent clickEvent(@Nullable ClickEvent event)
Componentevent - the click eventpublic @NonNull SelectorComponent hoverEvent(@Nullable HoverEvent event)
Componentevent - the hover eventpublic @NonNull SelectorComponent insertion(@Nullable java.lang.String insertion)
Componentinsertion - the insertion stringpublic @NonNull SelectorComponent mergeStyle(@NonNull Component that)
Componentthat - the other componentpublic @NonNull SelectorComponent mergeColor(@NonNull Component that)
Componentthat - the other componentpublic @NonNull SelectorComponent mergeDecorations(@NonNull Component that)
Componentthat - the other componentpublic @NonNull SelectorComponent mergeEvents(@NonNull Component that)
Componentthat - the other componentpublic @NonNull SelectorComponent resetStyle()
Componentpublic @NonNull SelectorComponent copy()
Componentpublic boolean equals(@Nullable java.lang.Object other)
equals in class AbstractComponentpublic int hashCode()
hashCode in class AbstractComponentprotected void populateToString(com.google.common.base.MoreObjects.ToStringHelper builder)
populateToString in class AbstractComponentpublic @NonNull SelectorComponent.Builder toBuilder()
BuildableComponent