Class ListHeader

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ListHeader extends GObject

Used by list widgets to represent the headers they display.

GtkListHeader objects are managed just like ListItem objects via their factory, but provide a different set of properties suitable for managing the header instead of individual items.

Since:
4.12
  • Constructor Details

    • ListHeader

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

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

    • getType

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

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

      protected ListHeader 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 GObject
      Returns:
      the instance as if it were its parent type
    • getChild

      public @Nullable Widget getChild()
      Gets the child previously set via gtk_list_header_set_child() or null if none was set.
      Returns:
      The child
      Since:
      4.12
    • getEnd

      public int getEnd()

      Gets the end position in the model of the section that this ListHeader is currently the header for.

      If this ListHeader is unbound, GTK_INVALID_LIST_POSITION is returned.

      Returns:
      The end position of the section
      Since:
      4.12
    • getItem

      public @Nullable GObject getItem()

      Gets the model item at the start of the section. This is the item that occupies the list model at position Gtk.ListHeader:start.

      If this ListHeader is unbound, this function returns null.

      Returns:
      The item displayed
      Since:
      4.12
    • getNItems

      public int getNItems()

      Gets the the number of items in the section.

      If this ListHeader is unbound, 0 is returned.

      Returns:
      The number of items in the section
      Since:
      4.12
    • getStart

      public int getStart()

      Gets the start position in the model of the section that this ListHeader is currently the header for.

      If this ListHeader is unbound, GTK_INVALID_LIST_POSITION is returned.

      Returns:
      The start position of the section
      Since:
      4.12
    • setChild

      public void setChild(@Nullable Widget child)

      Sets the child to be used for this listitem.

      This function is typically called by applications when setting up a header so that the widget can be reused when binding it multiple times.

      Parameters:
      child - The list item's child or null to unset
      Since:
      4.12
    • builder

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