Class PreferencesGroup

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public class PreferencesGroup extends Widget implements Accessible, Buildable, ConstraintTarget

A group of preference rows.

preferences-group

An AdwPreferencesGroup represents a group or tightly related preferences, which in turn are represented by PreferencesRow.

To summarize the role of the preferences it gathers, a group can have both a title and a description. The title will be used by PreferencesDialog to let the user look for a preference.

The PreferencesGroup:separate-rows property can be used to separate the rows within the group, same as when using the .boxed-list-separate style class instead of .boxed-list.

AdwPreferencesGroup as GtkBuildable

The AdwPreferencesGroup implementation of the Buildable interface supports adding PreferencesRows to the list by omitting "type". If "type" is omitted and the widget isn't a PreferencesRow the child is added to a box below the list.

When the "type" attribute of a child is header-suffix, the child is set as the suffix on the end of the title and description.

CSS nodes

AdwPreferencesGroup has a single CSS node with name preferencesgroup.

Accessibility

AdwPreferencesGroup uses the Gtk.AccessibleRole.group role.

  • Constructor Details

    • PreferencesGroup

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

      public PreferencesGroup()
      Create a new PreferencesGroup.
  • Method Details

    • getType

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

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

      protected PreferencesGroup asParent()
      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
    • add

      public void add(Widget child)
      Adds a child to self.
      Parameters:
      child - the widget to add
    • bindModel

      public void bindModel(@Nullable ListModel model, @Nullable ListBoxCreateWidgetFunc createRowFunc)

      Binds model to self.

      See ListBox#bindModel.

      Parameters:
      model - a list model to bind
      createRowFunc - a function creating a row for each item, or NULL in case model is NULL
      Since:
      1.8
    • getDescription

      public @Nullable String getDescription()
      Gets the description of self.
      Returns:
      the description of this PreferencesGroup
    • getHeaderSuffix

      public @Nullable Widget getHeaderSuffix()
      Gets the suffix for self's header.
      Returns:
      the suffix for self's header.
      Since:
      1.1
    • getRow

      public @Nullable Widget getRow(int index)

      Gets the row at index.

      Can return NULL if index is larger than the number of rows in the group.

      Parameters:
      index - a row index
      Returns:
      the row at index
      Since:
      1.8
    • getSeparateRows

      public boolean getSeparateRows()
      Gets whether self's rows are separated.
      Returns:
      whether rows are separated
      Since:
      1.6
    • getTitle

      public String getTitle()
      Gets the title of self.
      Returns:
      the title of this PreferencesGroup
    • remove

      public void remove(Widget child)
      Removes a child from self.
      Parameters:
      child - the child to remove
    • setDescription

      public void setDescription(@Nullable String description)
      Sets the description for self.
      Parameters:
      description - the description
    • setHeaderSuffix

      public void setHeaderSuffix(@Nullable Widget suffix)

      Sets the suffix for self's header.

      Displayed above the list, next to the title and description.

      Suffixes are commonly used to show a button or a spinner for the whole group.

      Parameters:
      suffix - the suffix to set
      Since:
      1.1
    • setSeparateRows

      public void setSeparateRows(boolean separateRows)

      Sets whether self's rows are separated.

      Equivalent to using the .boxed-list-separate style class on a ListBox instead of .boxed-list.

      Parameters:
      separateRows - whether to separate rows
      Since:
      1.6
    • setTitle

      public void setTitle(String title)
      Sets the title for self.
      Parameters:
      title - the title
    • builder

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