Record Class GuiUtils.ChoiceAction

java.lang.Object
java.lang.Record
sc.fiji.snt.gui.GuiUtils.ChoiceAction
Record Components:
label - the button label
icon - 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 keep label
enabled - tests whether the button is enabled for the choice at the given index
run - 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 Details

    • ChoiceAction

      public ChoiceAction(String label, Icon icon, String tooltip, String doneLabel, IntPredicate enabled, IntConsumer run)
      Creates an instance of a ChoiceAction record class.
      Parameters:
      label - the value for the label record component
      icon - the value for the icon record component
      tooltip - the value for the tooltip record component
      doneLabel - the value for the doneLabel record component
      enabled - the value for the enabled record component
      run - the value for the run record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • icon

      public Icon icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • tooltip

      public String tooltip()
      Returns the value of the tooltip record component.
      Returns:
      the value of the tooltip record component
    • doneLabel

      public String doneLabel()
      Returns the value of the doneLabel record component.
      Returns:
      the value of the doneLabel record component
    • enabled

      public IntPredicate enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • run

      public IntConsumer run()
      Returns the value of the run record component.
      Returns:
      the value of the run record component