Record Class GuiUtils.Notices.PendingNotice

java.lang.Object
java.lang.Record
sc.fiji.snt.gui.GuiUtils.Notices.PendingNotice
Record Components:
html - the notification's HTML-formatted message
url - an optional URL to be opened if the message is clicked, or null
action - an optional in-app action to be run if the message is clicked, or null. Unlike url (a link to somewhere outside the application)
logLevel - the notice's severity as defined by LogLevel, used to pick an accent icon for it.
Enclosing class:
GuiUtils.Notices

public static record GuiUtils.Notices.PendingNotice(String html, String url, Runnable action, int logLevel) extends Record
A notification message queued for a persistent notification-center UI element. Unlike a transient popup (see GuiUtils.showNotification(javax.swing.JLabel, boolean, int), an entry here is only removed by an explicit GuiUtils.Notices.dismissPendingNotice(PendingNotice) (or GuiUtils.Notices.clearPendingNotices()), so it survives indefinitely until the user actually acts on it
  • Field Details

  • Constructor Details

    • PendingNotice

      public PendingNotice(String html, String url, Runnable action)
    • PendingNotice

      public PendingNotice(String html, String url, Runnable action, int logLevel)
      Creates an instance of a PendingNotice record class.
      Parameters:
      html - the value for the html record component
      url - the value for the url record component
      action - the value for the action record component
      logLevel - the value for the logLevel 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. 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.
    • html

      public String html()
      Returns the value of the html record component.
      Returns:
      the value of the html record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • action

      public Runnable action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • logLevel

      public int logLevel()
      Returns the value of the logLevel record component.
      Returns:
      the value of the logLevel record component