Record Class MultiActionDialog

java.lang.Object
java.lang.Record
fr.fidorial.dialog.MultiActionDialog
All Implemented Interfaces:
Dialog, DialogDefinition, DialogLike

public record MultiActionDialog(DialogBase base, List<DialogActionButton> actions, int columns, @Nullable DialogActionButton exitAction) extends Record implements DialogDefinition
  • Field Details

    • DEFAULT_COLUMNS

      public static final int DEFAULT_COLUMNS
      Default number of columns.
      Since:
      0.1.0
      See Also:
  • Constructor Details

    • MultiActionDialog

      public MultiActionDialog(DialogBase base, List<DialogActionButton> actions, int columns, @Nullable DialogActionButton exitAction)
      Creates an instance of a MultiActionDialog record class.
      Parameters:
      base - the value for the base record component
      actions - the value for the actions record component
      columns - the value for the columns record component
      exitAction - the value for the exitAction record component
  • Method Details

    • of

      @Contract("_, _ -> new") public static MultiActionDialog of(DialogBase base, List<DialogActionButton> actions)
      Creates a grid of two columns and no footer.
      Parameters:
      base - the shared title, contents and behaviour
      actions - the buttons of the grid
      Returns:
      the dialog
      Since:
      0.1.0
    • columns

      @Contract("_ -> new") public MultiActionDialog columns(int columns)
      Parameters:
      columns - how many buttons sit side by side
      Returns:
      a copy of this dialog laid out in the given number of columns
      Since:
      0.1.0
    • exitAction

      @Contract("_ -> new") public MultiActionDialog exitAction(@Nullable DialogActionButton exitAction)
      Parameters:
      exitAction - the footer button, or null for no footer
      Returns:
      a copy of this dialog carrying the given footer
      Since:
      0.1.0
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • base

      public DialogBase base()
      Returns the value of the base record component.
      Specified by:
      base in interface DialogDefinition
      Returns:
      the value of the base record component
    • actions

      public List<DialogActionButton> actions()
      Returns the value of the actions record component.
      Returns:
      the value of the actions record component
    • columns

      public int columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • exitAction

      public @Nullable DialogActionButton exitAction()
      Returns the value of the exitAction record component.
      Returns:
      the value of the exitAction record component