Class TreeListRowSorter

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TreeListRowSorter extends Sorter

Applies a gives sorter to the levels in a tree.

Here is an example for setting up a column view with a tree model and a GtkTreeListSorter:

column_sorter = gtk_column_view_get_sorter (view);
sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter));
sort_model = gtk_sort_list_model_new (tree_model, sorter);
selection = gtk_single_selection_new (sort_model);
gtk_column_view_set_model (view, G_LIST_MODEL (selection));
  • Constructor Details

    • TreeListRowSorter

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

      public TreeListRowSorter(@Nullable Sorter sorter)

      Create a special-purpose sorter that applies the sorting of sorter to the levels of a GtkTreeListModel.

      Note that this sorter relies on Gtk.TreeListModel:passthrough being false as it can only sort TreeListRows.

      Parameters:
      sorter - a GtkSorter
    • TreeListRowSorter

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

    • getType

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

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

      protected TreeListRowSorter 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 Sorter
      Returns:
      the instance as if it were its parent type
    • getSorter

      public @Nullable Sorter getSorter()
      Returns the sorter used by self.
      Returns:
      the sorter used
    • setSorter

      public void setSorter(@Nullable Sorter sorter)

      Sets the sorter to use for items with the same parent.

      This sorter will be passed the Gtk.TreeListRow:item of the tree list rows passed to self.

      Parameters:
      sorter - The sorter to use
    • builder

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