Class ImageButtonBuilder
java.lang.Object
xyz.gmitch215.socketmc.screen.builder.WidgetBuilder<ImageButtonBuilder,ImageButton>
xyz.gmitch215.socketmc.screen.builder.ImageButtonBuilder
Represents a builder for an
ImageButton
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the widget.static @NotNull ImageButtonBuilder
builder()
Creates a new ImageButtonBuilder.Sets the message for the button.messageJSON
(@NotNull String messageJSON) Sets the message JSON for the button.Sets the sprite for the button.
-
Method Details
-
sprite
@NotNull public @NotNull ImageButtonBuilder sprite(@NotNull @NotNull Sprite sprite) throws IllegalArgumentException Sets the sprite for the button.- Parameters:
sprite
- Button Sprite- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException
- if sprite is null
-
message
@NotNull public @NotNull ImageButtonBuilder message(@NotNull @NotNull Text message) throws IllegalArgumentException Sets the message for the button.- Parameters:
message
- Button Message- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException
- if message is null
-
messageJSON
@NotNull public @NotNull ImageButtonBuilder messageJSON(@NotNull @NotNull String messageJSON) throws IllegalArgumentException Sets the message JSON for the button.- Parameters:
messageJSON
- Button Message JSON- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException
- if messageJSON is null
-
build
Description copied from class:WidgetBuilder
Builds the widget.- Specified by:
build
in classWidgetBuilder<ImageButtonBuilder,
ImageButton> - Returns:
- The built widget.
-
builder
Creates a new ImageButtonBuilder.- Returns:
ImageButton
Builder
-