Class Notification

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class Notification extends GObject
Holds information about a notification that should be shown to the user.
Since:
2.8
  • Constructor Details

    • Notification

      public Notification(MemorySegment address)
      Create a Notification instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Notification

      public Notification()
      Create a new Notification.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Notification class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Notification asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • clicked

      public void clicked()

      Tells WebKit the notification has been clicked.

      This will emit the WebKitNotification::clicked signal.

      Since:
      2.12
    • close

      public void close()
      Closes the notification.
      Since:
      2.8
    • getBody

      public String getBody()
      Obtains the body for the notification.
      Returns:
      the body for the notification
      Since:
      2.8
    • getId

      public long getId()
      Obtains the unique id for the notification.
      Returns:
      the unique id for the notification
      Since:
      2.8
    • getTag

      public @Nullable String getTag()
      Obtains the tag identifier for the notification.
      Returns:
      the tag for the notification
      Since:
      2.16
    • getTitle

      public String getTitle()
      Obtains the title for the notification.
      Returns:
      the title for the notification
      Since:
      2.8
    • onClicked

      Emitted when a notification has been clicked. See webkit_notification_clicked().
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.12
      See Also:
    • emitClicked

      public void emitClicked()
      Emits the "clicked" signal. See onClicked(Notification.ClickedCallback).
    • onClosed

      Emitted when a notification has been withdrawn.

      The default handler will close the notification using libnotify, if built with support for it.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.8
      See Also:
    • emitClosed

      public void emitClosed()
      Emits the "closed" signal. See onClosed(Notification.ClosedCallback).
    • builder

      public static Notification.Builder<? extends Notification.Builder> builder()
      A Notification.Builder object constructs a Notification with the specified properties. Use the various set...() methods to set properties, and finish construction with Notification.Builder.build().
      Returns:
      the builder object