Class FlattenListModel<T extends GObject>

All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>, ListModel<T>, SectionModel<T>, Proxy, ListModelJavaList<T>

@Generated("org.javagi.JavaGI") public class FlattenListModel<T extends GObject> extends GObject implements ListModel<T>, SectionModel<T>

A list model that concatenates other list models.

GtkFlattenListModel takes a list model containing list models, and flattens it into a single model. Each list model becomes a section in the single model.

  • Constructor Details

    • FlattenListModel

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

      public FlattenListModel(@Nullable ListModel model)
      Creates a new GtkFlattenListModel that flattens list.
      Parameters:
      model - the model to be flattened
    • FlattenListModel

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

    • getType

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

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

      protected FlattenListModel 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
    • getModel

      public @Nullable ListModel getModel()
      Gets the model set via gtk_flatten_list_model_set_model().
      Returns:
      The model flattened by this FlattenListModel
    • getModelForItem

      public @Nullable ListModel getModelForItem(int position)
      Returns the model containing the item at the given position.
      Parameters:
      position - a position
      Returns:
      the model containing the item at position
    • setModel

      public void setModel(@Nullable ListModel model)
      Sets a new model to be flattened.
      Parameters:
      model - the new model
    • builder

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