Class AppChooserWidget

All Implemented Interfaces:
PointerInterface

public class AppChooserWidget extends Widget
`GtkAppChooserWidget` is a widget for selecting applications.

It is the main building block for [class@Gtk.AppChooserDialog].
Most applications only need to use the latter; but you can use
this widget as part of a larger widget if you have special needs.

`GtkAppChooserWidget` offers detailed control over what applications
are shown, using the
[property@Gtk.AppChooserWidget:show-default],
[property@Gtk.AppChooserWidget:show-recommended],
[property@Gtk.AppChooserWidget:show-fallback],
[property@Gtk.AppChooserWidget:show-other] and
[property@Gtk.AppChooserWidget:show-all] properties. See the
[iface@Gtk.AppChooser] documentation for more information about these
groups of applications.

To keep track of the selected application, use the
[signal@Gtk.AppChooserWidget::application-selected] and
[signal@Gtk.AppChooserWidget::application-activated] signals.

# CSS nodes

`GtkAppChooserWidget` has a single CSS node with name appchooser.

https://docs.gtk.org/gtk4/class.AppChooserWidget.html

  • Field Details

  • Constructor Details

    • AppChooserWidget

      public AppChooserWidget(PointerContainer pointer)
    • AppChooserWidget

      public AppChooserWidget(@Nonnull Str content_type)
      Creates a new `GtkAppChooserWidget` for applications
      that can handle content of the given type.
      Parameters:
      content_type - the content type to show applications for
    • AppChooserWidget

      public AppChooserWidget(String content_type)
      Creates a new `GtkAppChooserWidget` for applications
      that can handle content of the given type.
      Parameters:
      content_type - the content type to show applications for
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getDefaultText

      public Str getDefaultText()
      Returns the text that is shown if there are not applications
      that can handle the content type.
      Returns:
      the value of [property@Gtk.AppChooserWidget:default-text]
    • getShowAll

      public boolean getShowAll()
      Gets whether the app chooser should show all applications
      in a flat list.
      Returns:
      the value of [property@Gtk.AppChooserWidget:show-all]
    • getShowDefault

      public boolean getShowDefault()
      Gets whether the app chooser should show the default handler
      for the content type in a separate section.
      Returns:
      the value of [property@Gtk.AppChooserWidget:show-default]
    • getShowFallback

      public boolean getShowFallback()
      Gets whether the app chooser should show related applications
      for the content type in a separate section.
      Returns:
      the value of [property@Gtk.AppChooserWidget:show-fallback]
    • getShowOther

      public boolean getShowOther()
      Gets whether the app chooser should show applications
      which are unrelated to the content type.
      Returns:
      the value of [property@Gtk.AppChooserWidget:show-other]
    • getShowRecommended

      public boolean getShowRecommended()
      Gets whether the app chooser should show recommended applications
      for the content type in a separate section.
      Returns:
      the value of [property@Gtk.AppChooserWidget:show-recommended]
    • setDefaultText

      public void setDefaultText(@Nonnull Str text)
      Sets the text that is shown if there are not applications
      that can handle the content type.
      Parameters:
      text - the new value for [property@Gtk.AppChooserWidget:default-text]
    • setDefaultText

      public void setDefaultText(String text)
      Sets the text that is shown if there are not applications
      that can handle the content type.
      Parameters:
      text - the new value for [property@Gtk.AppChooserWidget:default-text]
    • setShowAll

      public void setShowAll(boolean setting)
      Sets whether the app chooser should show all applications
      in a flat list.
      Parameters:
      setting - the new value for [property@Gtk.AppChooserWidget:show-all]
    • setShowDefault

      public void setShowDefault(boolean setting)
      Sets whether the app chooser should show the default handler
      for the content type in a separate section.
      Parameters:
      setting - the new value for [property@Gtk.AppChooserWidget:show-default]
    • setShowFallback

      public void setShowFallback(boolean setting)
      Sets whether the app chooser should show related applications
      for the content type in a separate section.
      Parameters:
      setting - the new value for [property@Gtk.AppChooserWidget:show-fallback]
    • setShowOther

      public void setShowOther(boolean setting)
      Sets whether the app chooser should show applications
      which are unrelated to the content type.
      Parameters:
      setting - the new value for [property@Gtk.AppChooserWidget:show-other]
    • setShowRecommended

      public void setShowRecommended(boolean setting)
      Sets whether the app chooser should show recommended applications
      for the content type in a separate section.
      Parameters:
      setting - the new value for [property@Gtk.AppChooserWidget:show-recommended]
    • onApplicationActivated

      public SignalHandler onApplicationActivated(AppChooserWidget.OnApplicationActivated signal)
      Connect to signal "application-activated".
      See AppChooserWidget.OnApplicationActivated.onApplicationActivated(ch.bailu.gtk.gio.AppInfo) for signal description.
      Field SIGNAL_ON_APPLICATION_ACTIVATED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onApplicationSelected

      public SignalHandler onApplicationSelected(AppChooserWidget.OnApplicationSelected signal)
      Connect to signal "application-selected".
      See AppChooserWidget.OnApplicationSelected.onApplicationSelected(ch.bailu.gtk.gio.AppInfo) for signal description.
      Field SIGNAL_ON_APPLICATION_SELECTED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asAppChooser

      public AppChooser asAppChooser()
      Implements interface AppChooser. Call this to get access to interface functions.
      Returns:
      AppChooser
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()