Interface DialogInput

All Known Implementing Classes:
DialogInput.Bool, DialogInput.NumberRange, DialogInput.SingleOption, DialogInput.Text

  • Field Details

    • MAX_WIDTH

      static final int MAX_WIDTH
      Largest width the client accepts for an input control.
      Since:
      0.1.0
      See Also:
    • DEFAULT_WIDTH

      static final int DEFAULT_WIDTH
      Default width of an input control.
      Since:
      0.1.0
      See Also:
  • Method Details

    • text

      @Contract("_, _ -> new") static DialogInput.Text.Builder text(String key, ComponentLike label)
      Starts building a single line text field.
      Parameters:
      key - the identifier the value is sent under
      label - the label displayed next to the field
      Returns:
      a fresh builder
      Since:
      0.1.0
    • checkbox

      @Contract("_, _ -> new") static DialogInput.Bool checkbox(String key, ComponentLike label)
      Creates an unchecked checkbox sending true or false.
      Parameters:
      key - the identifier the value is sent under
      label - the label displayed next to the checkbox
      Returns:
      the input control
      Since:
      0.1.0
    • singleOption

      @Contract("_, _ -> new") static DialogInput.SingleOption.Builder singleOption(String key, ComponentLike label)
      Starts building a preset option selection.
      Parameters:
      key - the identifier the value is sent under
      label - the label displayed next to the control
      Returns:
      a fresh builder
      Since:
      0.1.0
    • numberRange

      @Contract("_, _, _, _ -> new") static DialogInput.NumberRange.Builder numberRange(String key, ComponentLike label, float start, float end)
      Starts building a number slider.
      Parameters:
      key - the identifier the value is sent under
      label - the label displayed next to the slider
      start - the lowest value of the slider
      end - the highest value of the slider
      Returns:
      a fresh builder
      Since:
      0.1.0
    • key

      String key()
      Returns the identifier the submitted value is sent under.

      Only letters, digits and _ are allowed, so that the key is usable as a macro argument.

      Returns:
      the identifier the submitted value is sent under
      Since:
      0.1.0
    • label

      Component label()
      Returns the label displayed to the left of the control.
      Returns:
      the label displayed to the left of the control
      Since:
      0.1.0