Class InfoBar.Builder<B extends InfoBar.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
InfoBar

public static class InfoBar.Builder<B extends InfoBar.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public InfoBar build()
      Finish building the InfoBar object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to InfoBar.
      Overrides:
      build in class Widget.Builder<B extends InfoBar.Builder<B>>
      Returns:
      a new instance of InfoBar with the properties that were set in the Builder object.
    • setMessageType

      public B setMessageType(MessageType messageType)

      The type of the message.

      The type may be used to determine the appearance of the info bar.

      Parameters:
      messageType - the value for the message-type property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRevealed

      public B setRevealed(boolean revealed)
      Whether the info bar shows its contents.
      Parameters:
      revealed - the value for the revealed property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowCloseButton

      public B setShowCloseButton(boolean showCloseButton)
      Whether to include a standard close button.
      Parameters:
      showCloseButton - the value for the show-close-button property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onClose

      public B onClose(InfoBar.CloseCallback handler)

      Gets emitted when the user uses a keybinding to dismiss the info bar.

      The ::close signal is a keybinding signal.

      The default binding for this signal is the Escape key.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onResponse

      public B onResponse(InfoBar.ResponseCallback handler)

      Emitted when an action widget is clicked.

      The signal is also emitted when the application programmer calls InfoBar.response(int). The responseId depends on which action widget was clicked.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: