Record Class DialogInput.SingleOption
java.lang.Object
java.lang.Record
fr.fidorial.dialog.DialogInput.SingleOption
- Record Components:
key- the identifier the value is sent underlabel- the label displayed to the left of the controloptions- the options to pick from, never emptylabelVisible- whether the label is drawn at allwidth- the width of the control, between 1 and 1024
- All Implemented Interfaces:
DialogInput
- Enclosing interface:
DialogInput
public static record DialogInput.SingleOption(String key, Component label, List<DialogInput.SingleOption.Entry> options, boolean labelVisible, int width)
extends Record
implements DialogInput
A drop-down of preset options.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent builder forDialogInput.SingleOption.static final recordOne entry of aDialogInput.SingleOptioncontrol.Nested classes/interfaces inherited from interface DialogInput
DialogInput.Bool, DialogInput.NumberRange, DialogInput.SingleOption, DialogInput.Text -
Field Summary
Fields inherited from interface DialogInput
DEFAULT_WIDTH, MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionSingleOption(String key, Component label, List<DialogInput.SingleOption.Entry> options, boolean labelVisible, int width) Creates an instance of aSingleOptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.label()Returns the value of thelabelrecord component.booleanReturns the value of thelabelVisiblerecord component.options()Returns the value of theoptionsrecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
SingleOption
public SingleOption(String key, Component label, List<DialogInput.SingleOption.Entry> options, boolean labelVisible, int width) Creates an instance of aSingleOptionrecord class.- Parameters:
key- the value for thekeyrecord componentlabel- the value for thelabelrecord componentoptions- the value for theoptionsrecord componentlabelVisible- the value for thelabelVisiblerecord componentwidth- the value for thewidthrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceDialogInput- Returns:
- the value of the
keyrecord component
-
label
Returns the value of thelabelrecord component.- Specified by:
labelin interfaceDialogInput- Returns:
- the value of the
labelrecord component
-
options
-
labelVisible
public boolean labelVisible()Returns the value of thelabelVisiblerecord component.- Returns:
- the value of the
labelVisiblerecord component
-
width
-