Class Banner.Builder<B extends Banner.Builder<B>>

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

public static class Banner.Builder<B extends Banner.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Actionable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
1.3
  • Constructor Details

    • Builder

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

    • build

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

      public B setButtonLabel(String buttonLabel)

      The label to show on the button.

      If set to "" or NULL, the button won't be shown.

      The button can be used with a GAction, or with the Banner::button-clicked signal.

      Parameters:
      buttonLabel - the value for the button-label property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setButtonStyle

      public B setButtonStyle(BannerButtonStyle buttonStyle)

      The style class to use for the banner button.

      When set to Adw.BannerButtonStyle.default, the button is grey. When set to Adw.BannerButtonStyle.suggested, the button uses the .suggested-action appearance.

      banner with suggested button style
      Parameters:
      buttonStyle - the value for the button-style property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setRevealed

      public B setRevealed(boolean revealed)
      Whether the banner is currently revealed.
      Parameters:
      revealed - the value for the revealed property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setTitle

      public B setTitle(String title)

      The title for this banner.

      See also: Banner:use-markup.

      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setUseMarkup

      public B setUseMarkup(boolean useMarkup)

      Whether to use Pango markup for the banner title.

      See also Pango#parseMarkup.

      Parameters:
      useMarkup - the value for the use-markup property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • onButtonClicked

      public B onButtonClicked(Banner.ButtonClickedCallback handler)

      This signal is emitted after the action button has been clicked.

      It can be used as an alternative to setting an action.

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