Interface DialogInput

All Known Subinterfaces:
BooleanDialogInput, NumberRangeDialogInput, SingleOptionDialogInput, TextDialogInput

Represents an input for dialog.
  • Method Details

    • bool

      @Contract(pure=true, value="_, _, _, _, _ -> new") static BooleanDialogInput bool(String key, Component label, boolean initial, String onTrue, String onFalse)
      Creates a boolean dialog input.
      Parameters:
      key - the key identifier for the input
      label - the label for the input
      initial - the initial value of the input
      onTrue - the input's value in a template when the value is true
      onFalse - the input's value in a template when the value is false
      Returns:
      a new boolean dialog input instance
    • bool

      @Contract(pure=true, value="_, _ -> new") static BooleanDialogInput.Builder bool(String key, Component label)
      Creates a new builder for a boolean dialog input.
      Parameters:
      key - the key identifier for the input
      label - the label for the input
      Returns:
      a new builder instance
    • numberRange

      @Contract(pure=true, value="_, _, _, _, _, _, _, _ -> new") static NumberRangeDialogInput numberRange(String key, @org.jetbrains.annotations.Range(from=1L, to=1024L) int width, Component label, String labelFormat, float start, float end, @Nullable Float initial, @Positive @Nullable Float step)
      Creates a number range dialog input.
      Parameters:
      key - the key identifier for the input
      width - the width of the input
      label - the label for the input
      labelFormat - the format for the label (a translation key or format string)
      start - the start of the range
      end - the end of the range
      initial - the initial value, or null if not set
      step - the step size, or null if not set
      Returns:
      a new number range dialog input instance
    • numberRange

      @Contract(value="_, _, _, _ -> new", pure=true) static NumberRangeDialogInput.Builder numberRange(String key, Component label, float start, float end)
      Creates a new builder for a number range dialog input.
      Parameters:
      key - the key identifier for the input
      label - the label for the input
      start - the start of the range
      end - the end of the range
      Returns:
      a new builder instance
    • singleOption

      @Contract(pure=true, value="_, _, _, _, _ -> new") static SingleOptionDialogInput singleOption(String key, @org.jetbrains.annotations.Range(from=1L, to=1024L) int width, List<SingleOptionDialogInput.OptionEntry> entries, Component label, boolean labelVisible)
      Creates a single option dialog input (radio input).
      Parameters:
      key - the key identifier for the input
      width - the width of the input
      entries - the list of options for the input
      label - the label for the input
      labelVisible - whether the label should be visible
      Returns:
      a new single option dialog input instance
    • singleOption

      @Contract(value="_, _, _ -> new", pure=true) static SingleOptionDialogInput.Builder singleOption(String key, Component label, List<SingleOptionDialogInput.OptionEntry> entries)
      Creates a new builder for a single option dialog input.
      Parameters:
      key - the key identifier for the input
      label - the label for the input
      entries - the list of options for the input
      Returns:
      a new builder instance
    • text

      @Contract(pure=true, value="_, _, _, _, _, _, _ -> new") static TextDialogInput text(String key, @org.jetbrains.annotations.Range(from=1L, to=1024L) int width, Component label, boolean labelVisible, String initial, @org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLength, @Nullable TextDialogInput.MultilineOptions multilineOptions)
      Creates a text dialog input.
      Parameters:
      key - the key identifier for the input
      width - the width of the input
      label - the label for the input
      labelVisible - whether the label should be visible
      initial - the initial value of the input
      maxLength - the maximum length of the input
      multilineOptions - the multiline options
      Returns:
      a new text dialog input instance
    • text

      @Contract(value="_, _ -> new", pure=true) static TextDialogInput.Builder text(String key, Component label)
      Creates a new builder for a text dialog input.
      Parameters:
      key - the key identifier for the input
      label - the label for the input
      Returns:
      a new builder instance
    • key

      @Contract(pure=true, value=" -> new") String key()
      Gets the key for this input.

      Used in dialog actions to identify this dialog input's value

      Returns:
      the key