Class AppChooserButton.Builder<B extends AppChooserButton.Builder<B>>

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

public static class AppChooserButton.Builder<B extends AppChooserButton.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, AppChooser.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 AppChooserButton build()
      Finish building the AppChooserButton object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to AppChooserButton.
      Overrides:
      build in class Widget.Builder<B extends AppChooserButton.Builder<B>>
      Returns:
      a new instance of AppChooserButton with the properties that were set in the Builder object.
    • setHeading

      public B setHeading(String heading)

      The text to show at the top of the dialog that can be opened from the button.

      The string may contain Pango markup.

      Parameters:
      heading - the value for the heading property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setModal

      public B setModal(boolean modal)
      Whether the app chooser dialog should be modal.
      Parameters:
      modal - the value for the modal property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowDefaultItem

      public B setShowDefaultItem(boolean showDefaultItem)
      Determines whether the dropdown menu shows the default application on top for the provided content type.
      Parameters:
      showDefaultItem - the value for the show-default-item property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowDialogItem

      public B setShowDialogItem(boolean showDialogItem)
      Determines whether the dropdown menu shows an item to open a GtkAppChooserDialog.
      Parameters:
      showDialogItem - the value for the show-dialog-item property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onActivate

      public B onActivate(AppChooserButton.ActivateCallback handler)

      Emitted to when the button is activated.

      The ::activate signal on GtkAppChooserButton is an action signal and emitting it causes the button to pop up its dialog.

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

      public B onChanged(AppChooserButton.ChangedCallback handler)
      Emitted when the active application changes.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onCustomItemActivated

      public B onCustomItemActivated(@Nullable String detail, AppChooserButton.CustomItemActivatedCallback handler)

      Emitted when a custom item is activated.

      Use AppChooserButton.appendCustomItem(String, String, Icon), to add custom items.

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