Record Class DialogActionButton
java.lang.Object
java.lang.Record
fr.fidorial.dialog.DialogActionButton
- Record Components:
label- the text of the buttontooltip- the text shown on hover, ornullwidth- the width of the button, between 1 and 1024action- what pressing the button does, ornullto only close the dialog
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault width of a button.static final intLargest width the client accepts for a button. -
Constructor Summary
ConstructorsConstructorDescriptionDialogActionButton(Component label, @Nullable Component tooltip, int width, @Nullable DialogAction action) Creates an instance of aDialogActionButtonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.static DialogActionButton.Builderbuilder(ComponentLike label) Starts building a button.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.static DialogActionButtonof(ComponentLike label) Creates a button of the default width that only dismisses the dialog.static DialogActionButtonof(ComponentLike label, DialogAction action) Creates a button of the default width.tooltip()Returns the value of thetooltiprecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
MAX_WIDTH
public static final int MAX_WIDTHLargest width the client accepts for a button.- Since:
- 0.1.0
- See Also:
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTHDefault width of a button.- Since:
- 0.1.0
- See Also:
-
-
Constructor Details
-
DialogActionButton
public DialogActionButton(Component label, @Nullable Component tooltip, int width, @Nullable DialogAction action) Creates an instance of aDialogActionButtonrecord class.
-
-
Method Details
-
of
Creates a button of the default width that only dismisses the dialog.- Parameters:
label- the text on the button- Returns:
- the button
- Since:
- 0.1.0
-
of
@Contract("_, _ -> new") public static DialogActionButton of(ComponentLike label, DialogAction action) Creates a button of the default width.- Parameters:
label- the text on the buttonaction- what pressing the button does- Returns:
- the button
- Since:
- 0.1.0
-
builder
Starts building a button.- Parameters:
label- the text on the button- Returns:
- a fresh builder
- Since:
- 0.1.0
-
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. -
label
-
tooltip
-
width
-
action
-