Class AppChooserWidget.Builder<B extends AppChooserWidget.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:
AppChooserWidget

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

      public B setDefaultText(String defaultText)
      The text that appears in the widget when there are no applications for the given content type.
      Parameters:
      defaultText - the value for the default-text property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowAll

      public B setShowAll(boolean showAll)
      If true, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.
      Parameters:
      showAll - the value for the show-all property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowDefault

      public B setShowDefault(boolean showDefault)

      Determines whether the app chooser should show the default handler for the content type in a separate section.

      If false, the default handler is listed among the recommended applications.

      Parameters:
      showDefault - the value for the show-default property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowFallback

      public B setShowFallback(boolean showFallback)

      Determines whether the app chooser should show a section for fallback applications.

      If false, the fallback applications are listed among the other applications.

      Parameters:
      showFallback - the value for the show-fallback property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowOther

      public B setShowOther(boolean showOther)
      Determines whether the app chooser should show a section for other applications.
      Parameters:
      showOther - the value for the show-other property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowRecommended

      public B setShowRecommended(boolean showRecommended)

      Determines whether the app chooser should show a section for recommended applications.

      If false, the recommended applications are listed among the other applications.

      Parameters:
      showRecommended - the value for the show-recommended property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onApplicationActivated

      public B onApplicationActivated(AppChooserWidget.ApplicationActivatedCallback handler)

      Emitted when an application item is activated from the widget's list.

      This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.

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

      public B onApplicationSelected(AppChooserWidget.ApplicationSelectedCallback handler)
      Emitted when an application item is selected from the widget's list.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: