Interface TextInput

All Superinterfaces:
Composable, ComposableLike, Configurable<TextInput>, Disable, ProviderRendered

public interface TextInput extends Disable, ProviderRendered, Configurable<TextInput>
A text input is a component that can handle user input.
See more in Flare docs: Text Input
  • Method Details

    • inputItemBuilder

      @NotNull static @NotNull ItemStackBuilder inputItemBuilder(@NotNull @NotNull String currentText, String name, String description)
      Returns an item builder for a text input
      Parameters:
      currentText - Current text value
      name - Extra message in item name
      description - Description in item lore
      Returns:
      An item builder for a text input
    • inputItem

      @NotNull static @NotNull ItemProvider inputItem(@NotNull @NotNull ReactiveState<String> text, String name, String description)
      Returns an item provider for a text input
      Parameters:
      text - Reactive state of the text value
      name - Extra message in item name
      description - Description in item lore
      Returns:
      An item builder for a text input
    • of

      @Contract("_ -> new") @NotNull static @NotNull TextInput of(ItemProvider provider)
      Constructs a new text input with an item provider
      Parameters:
      provider - The item provider to use
      Returns:
      A new text input
    • of

      @Contract("_, _ -> new") @NotNull static @NotNull TextInput of(ItemProvider provider, boolean disabled)
      Constructs a new text input with an item provider
      Parameters:
      provider - The item provider to use
      disabled - Whether the text input should be disabled
      Returns:
      A new text input
    • builder

      @NotNull static @NotNull TextInput.Builder builder(@Nullable @Nullable ItemProvider provider)
      Constructs a new text input builder
      Parameters:
      provider - Item provider to use
      Returns:
      A new text input builder
    • builder

      @NotNull static @NotNull TextInput.Builder builder(@Nullable @Nullable String name, @Nullable @Nullable String description)
      Constructs a new text input builder
      Parameters:
      name - Extra message in item name
      description - Extra message in item lore
      Returns:
      A new text input builder
    • builder

      @NotNull static @NotNull TextInput.Builder builder()
      Constructs a new text input builder
      Returns:
      A new text input builder
    • getText

      @NotNull default @NotNull String getText()
      Returns current text value
      Returns:
      Current text value
    • setText

      default void setText(@NotNull @NotNull String text)
      Sets current text
      Parameters:
      text - Text to be set
    • getPrompt

      @NotNull default @NotNull String getPrompt()
      Returns the default prompt
      Returns:
      The default prompt
    • setPrompt

      default void setPrompt(String prompt)
      Sets the default prompt
      Parameters:
      prompt - The prompt to set
    • textState

      ReactiveState<String> textState()
      Returns the input text reactive state
      Returns:
      The input text reactive state
    • promptState

      ReactiveState<String> promptState()
      Returns the prompt reactive state
      Returns:
      The input text reactive state
    • getValidator

      @Nullable @Nullable Validator getValidator()
      Returns the input validator
      Returns:
      The input validator
    • configure

      default TextInput configure(@NotNull @NotNull Configurable.Configurator<TextInput> configurator)
      Description copied from interface: Configurable
      Configures this composable element.
      Specified by:
      configure in interface Configurable<TextInput>
      Parameters:
      configurator - Configurator to be applied
      Returns:
      The configured object
    • onTextChange

      default void onTextChange(ReactiveSubscriber<@NotNull String> change)
      Adds a handler to text change
      Parameters:
      change - Handler for the text change
    • click

      default void click(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from interface: Composable
      Called each time this item is clicked, no matter if it is a right click, left click, middle click, etc.
      Specified by:
      click in interface Composable
      Parameters:
      e - The click event