Interface DialogInput
- All Known Subinterfaces:
BooleanDialogInput,NumberRangeDialogInput,SingleOptionDialogInput,TextDialogInput
public sealed interface DialogInput
permits BooleanDialogInput, NumberRangeDialogInput, SingleOptionDialogInput, TextDialogInput
Represents an input for dialog.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanDialogInput.BuilderCreates a new builder for a boolean dialog input.static BooleanDialogInputCreates a boolean dialog input.key()Gets the key for this input.static NumberRangeDialogInputnumberRange(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.numberRange(String key, Component label, float start, float end) Creates a new builder for a number range dialog input.static SingleOptionDialogInputsingleOption(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).singleOption(String key, Component label, List<SingleOptionDialogInput.OptionEntry> entries) Creates a new builder for a single option dialog input.static TextDialogInputtext(String key, @org.jetbrains.annotations.Range(from=1L, to=1024L) int width, Component label, boolean labelVisible, String initial, @org.checkerframework.checker.index.qual.Positive int maxLength, @Nullable TextDialogInput.MultilineOptions multilineOptions) Creates a text dialog input.static TextDialogInput.BuilderCreates a new builder for a text dialog input.
-
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 inputlabel- the label for the inputinitial- the initial value of the inputonTrue- the input's value in a template when the value is trueonFalse- 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 inputlabel- 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 inputwidth- the width of the inputlabel- the label for the inputlabelFormat- the format for the label (a translation key or format string)start- the start of the rangeend- the end of the rangeinitial- the initial value, or null if not setstep- the step size, or null if not set- Returns:
- a new number range dialog input instance
-
numberRange
@Contract(pure=true, value="_, _, _, _ -> new") 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 inputlabel- the label for the inputstart- the start of the rangeend- 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 inputwidth- the width of the inputentries- the list of options for the inputlabel- the label for the inputlabelVisible- whether the label should be visible- Returns:
- a new single option dialog input instance
-
singleOption
@Contract(pure=true, value="_, _, _ -> new") 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 inputlabel- the label for the inputentries- 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.checkerframework.checker.index.qual.Positive int maxLength, @Nullable TextDialogInput.MultilineOptions multilineOptions) Creates a text dialog input.- Parameters:
key- the key identifier for the inputwidth- the width of the inputlabel- the label for the inputlabelVisible- whether the label should be visibleinitial- the initial value of the inputmaxLength- the maximum length of the inputmultilineOptions- the multiline options, or null if not set- 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 inputlabel- the label for the input- Returns:
- a new builder instance
-
key
Gets the key for this input.Used in dialog actions to identify this dialog input's value
- Returns:
- the key
-