Class AppChooserButton

All Implemented Interfaces:
Accessible, AppChooser, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public class AppChooserButton extends Widget implements Accessible, AppChooser, Buildable, ConstraintTarget
Deprecated.
The application selection widgets should be implemented according to the design of each platform and/or application requiring them.

The GtkAppChooserButton lets the user select an application.

An example GtkAppChooserButton

Initially, a GtkAppChooserButton selects the first application in its list, which will either be the most-recently used application or, if Gtk.AppChooserButton:show-default-item is true, the default application.

The list of applications shown in a GtkAppChooserButton includes the recommended applications for the given content type. When Gtk.AppChooserButton:show-default-item is set, the default application is also included. To let the user chooser other applications, you can set the Gtk.AppChooserButton:show-dialog-item property, which allows to open a full AppChooserDialog.

It is possible to add custom items to the list, using appendCustomItem(String, String, Icon). These items cause the Gtk.AppChooserButton::custom-item-activated signal to be emitted when they are selected.

To track changes in the selected application, use the Gtk.AppChooserButton::changed signal.

CSS nodes

GtkAppChooserButton has a single CSS node with the name “appchooserbutton”.

  • Constructor Details

    • AppChooserButton

      public AppChooserButton(MemorySegment address)
      Deprecated.
      Create a AppChooserButton instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • AppChooserButton

      @Deprecated public AppChooserButton(String contentType)
      Deprecated.
      This widget will be removed in GTK 5
      Creates a new GtkAppChooserButton for applications that can handle content of the given type.
      Parameters:
      contentType - the content type to show applications for
    • AppChooserButton

      public AppChooserButton()
      Deprecated.
      Create a new AppChooserButton.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the AppChooserButton class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected AppChooserButton asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • appendCustomItem

      @Deprecated public void appendCustomItem(String name, String label, Icon icon)
      Deprecated.
      This widget will be removed in GTK 5

      Appends a custom item to the list of applications that is shown in the popup.

      The item name must be unique per-widget. Clients can use the provided name as a detail for the Gtk.AppChooserButton::custom-item-activated signal, to add a callback for the activation of a particular custom item in the list.

      See also appendSeparator().

      Parameters:
      name - the name of the custom item
      label - the label for the custom item
      icon - the icon for the custom item
    • appendSeparator

      @Deprecated public void appendSeparator()
      Deprecated.
      This widget will be removed in GTK 5
      Appends a separator to the list of applications that is shown in the popup.
    • getHeading

      @Deprecated public @Nullable String getHeading()
      Deprecated.
      This widget will be removed in GTK 5
      Returns the text to display at the top of the dialog.
      Returns:
      the text to display at the top of the dialog, or null, in which case a default text is displayed
    • getModal

      @Deprecated public boolean getModal()
      Deprecated.
      This widget will be removed in GTK 5
      Gets whether the dialog is modal.
      Returns:
      true if the dialog is modal
    • getShowDefaultItem

      @Deprecated public boolean getShowDefaultItem()
      Deprecated.
      This widget will be removed in GTK 5
      Returns whether the dropdown menu should show the default application at the top.
      Returns:
      the value of Gtk.AppChooserButton:show-default-item
    • getShowDialogItem

      @Deprecated public boolean getShowDialogItem()
      Deprecated.
      This widget will be removed in GTK 5
      Returns whether the dropdown menu shows an item for a GtkAppChooserDialog.
      Returns:
      the value of Gtk.AppChooserButton:show-dialog-item
    • setActiveCustomItem

      @Deprecated public void setActiveCustomItem(String name)
      Deprecated.
      This widget will be removed in GTK 5

      Selects a custom item.

      See appendCustomItem(String, String, Icon).

      Use AppChooser.refresh() to bring the selection to its initial state.

      Parameters:
      name - the name of the custom item
    • setHeading

      @Deprecated public void setHeading(String heading)
      Deprecated.
      This widget will be removed in GTK 5

      Sets the text to display at the top of the dialog.

      If the heading is not set, the dialog displays a default text.

      Parameters:
      heading - a string containing Pango markup
    • setModal

      @Deprecated public void setModal(boolean modal)
      Deprecated.
      This widget will be removed in GTK 5
      Sets whether the dialog should be modal.
      Parameters:
      modal - true to make the dialog modal
    • setShowDefaultItem

      @Deprecated public void setShowDefaultItem(boolean setting)
      Deprecated.
      This widget will be removed in GTK 5
      Sets whether the dropdown menu of this button should show the default application for the given content type at top.
      Parameters:
      setting - the new value for Gtk.AppChooserButton:show-default-item
    • setShowDialogItem

      @Deprecated public void setShowDialogItem(boolean setting)
      Deprecated.
      This widget will be removed in GTK 5
      Sets whether the dropdown menu of this button should show an entry to trigger a GtkAppChooserDialog.
      Parameters:
      setting - the new value for Gtk.AppChooserButton:show-dialog-item
    • onActivate

      Deprecated.

      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:
      a signal handler ID to keep track of the signal connection
      Since:
      4.4
      See Also:
    • emitActivate

      public void emitActivate()
      Deprecated.
      Emits the "activate" signal. See onActivate(AppChooserButton.ActivateCallback).
    • onChanged

      Deprecated.
      Emitted when the active application changes.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitChanged

      public void emitChanged()
      Deprecated.
      Emits the "changed" signal. See onChanged(AppChooserButton.ChangedCallback).
    • onCustomItemActivated

      Deprecated.

      Emitted when a custom item is activated.

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

      Parameters:
      detail - the signal detail
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitCustomItemActivated

      public void emitCustomItemActivated(@Nullable String detail, String itemName)
      Deprecated.
    • builder

      public static AppChooserButton.Builder<? extends AppChooserButton.Builder> builder()
      Deprecated.
      A AppChooserButton.Builder object constructs a AppChooserButton with the specified properties. Use the various set...() methods to set properties, and finish construction with AppChooserButton.Builder.build().
      Returns:
      the builder object