Package su.onno.ui

Record Class RefOptionDecoration

java.lang.Object
java.lang.Record
su.onno.ui.RefOptionDecoration
Record Components:
badge - short status label shown beside the option
tone - semantic badge colour; ignored when color is set
color - optional explicit CSS colour (normally a hex value)
disabled - whether the option can be selected
reason - optional explanation shown below a disabled option
hidden - whether the option is filtered out of this contextual result page

public record RefOptionDecoration(String badge, RefOptionTone tone, String color, boolean disabled, String reason, boolean hidden) extends Record
Context-dependent presentation and selection state for one reference-picker option.
  • Constructor Details

    • RefOptionDecoration

      public RefOptionDecoration(String badge, RefOptionTone tone, String color, boolean disabled, String reason, boolean hidden)
      Creates an instance of a RefOptionDecoration record class.
      Parameters:
      badge - the value for the badge record component
      tone - the value for the tone record component
      color - the value for the color record component
      disabled - the value for the disabled record component
      reason - the value for the reason record component
      hidden - the value for the hidden record component
  • Method Details

    • badge

      public static RefOptionDecoration badge(String label, RefOptionTone tone)
    • disabled

      public static RefOptionDecoration disabled(String label, RefOptionTone tone, String reason)
    • filteredOut

      public static RefOptionDecoration filteredOut()
      Filter an option from the current search result using live form/row context.
    • 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 '=='.
      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.
    • badge

      public String badge()
      Returns the value of the badge record component.
      Returns:
      the value of the badge record component
    • tone

      public RefOptionTone tone()
      Returns the value of the tone record component.
      Returns:
      the value of the tone record component
    • color

      public String color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • disabled

      public boolean disabled()
      Returns the value of the disabled record component.
      Returns:
      the value of the disabled record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • hidden

      public boolean hidden()
      Returns the value of the hidden record component.
      Returns:
      the value of the hidden record component