Package sc.fiji.snt.gui
Record Class GuiUtils.ChoiceAction
java.lang.Object
java.lang.Record
sc.fiji.snt.gui.GuiUtils.ChoiceAction
- Record Components:
label- the button labelicon- the button icon (can be null)tooltip- the button tooltip (can be null)doneLabel- the label shown after the button is pressed (e.g., "Copied"), until the selection changes. Null to keeplabelenabled- tests whether the button is enabled for the choice at the given indexrun- the action, given the index of the selected choice
- Enclosing class:
GuiUtils
public static record GuiUtils.ChoiceAction(String label, Icon icon, String tooltip, String doneLabel, IntPredicate enabled, IntConsumer run)
extends Record
A button displayed below the description of the selected choice of
GuiUtils.getChoice(String, String, String[], String[], String, BiFunction, List)-
Constructor Summary
ConstructorsConstructorDescriptionChoiceAction(String label, Icon icon, String tooltip, String doneLabel, IntPredicate enabled, IntConsumer run) Creates an instance of aChoiceActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedoneLabelrecord component.enabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.icon()Returns the value of theiconrecord component.label()Returns the value of thelabelrecord component.run()Returns the value of therunrecord component.tooltip()Returns the value of thetooltiprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChoiceAction
public ChoiceAction(String label, Icon icon, String tooltip, String doneLabel, IntPredicate enabled, IntConsumer run) Creates an instance of aChoiceActionrecord class.- Parameters:
label- the value for thelabelrecord componenticon- the value for theiconrecord componenttooltip- the value for thetooltiprecord componentdoneLabel- the value for thedoneLabelrecord componentenabled- the value for theenabledrecord componentrun- the value for therunrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
tooltip
Returns the value of thetooltiprecord component.- Returns:
- the value of the
tooltiprecord component
-
doneLabel
Returns the value of thedoneLabelrecord component.- Returns:
- the value of the
doneLabelrecord component
-
enabled
Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
run
Returns the value of therunrecord component.- Returns:
- the value of the
runrecord component
-