Class ColumnViewCell

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ColumnViewCell extends ListItem

Represents items in a cell in ColumnView.

The GtkColumnViewCells are managed by the ColumnView widget (with its factory) and cannot be created by applications, but they need to be populated by application code. This is done by calling setChild(Widget).

GtkColumnViewCells exist in 2 stages:

  1. The unbound stage where the listitem is not currently connected to an item in the list. In that case, the Gtk.ColumnViewCell:item property is set to null.

  2. The bound stage where the listitem references an item from the list. The Gtk.ColumnViewCell:item property is not null.

Since:
4.12
  • Constructor Details

    • ColumnViewCell

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

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

    • getType

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

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

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

      public @Nullable Widget getChild()
      Gets the child previously set via gtk_column_view_cell_set_child() or null if none was set.
      Overrides:
      getChild in class ListItem
      Returns:
      The child
      Since:
      4.12
    • getFocusable

      public boolean getFocusable()
      Checks if a list item has been set to be focusable via gtk_column_view_cell_set_focusable().
      Overrides:
      getFocusable in class ListItem
      Returns:
      true if the item is focusable
      Since:
      4.12
    • getItem

      public @Nullable GObject getItem()

      Gets the model item that associated with self.

      If this ColumnViewCell is unbound, this function returns null.

      Overrides:
      getItem in class ListItem
      Returns:
      The item displayed
      Since:
      4.12
    • getPosition

      public int getPosition()

      Gets the position in the model that this ColumnViewCell currently displays.

      If this ColumnViewCell is unbound, GTK_INVALID_LIST_POSITION is returned.

      Overrides:
      getPosition in class ListItem
      Returns:
      The position of this item
      Since:
      4.12
    • getSelected

      public boolean getSelected()

      Checks if the item is displayed as selected.

      The selected state is maintained by the list widget and its model and cannot be set otherwise.

      Overrides:
      getSelected in class ListItem
      Returns:
      true if the item is selected.
      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 listitem so that the widget can be reused when binding it multiple times.

      Overrides:
      setChild in class ListItem
      Parameters:
      child - The list item's child or null to unset
      Since:
      4.12
    • setFocusable

      public void setFocusable(boolean focusable)

      Sets this ColumnViewCell to be focusable.

      If an item is focusable, it can be focused using the keyboard. This works similar to Widget.setFocusable(boolean).

      Note that if items are not focusable, the keyboard cannot be used to activate them and selecting only works if one of the listitem's children is focusable.

      By default, list items are focusable.

      Overrides:
      setFocusable in class ListItem
      Parameters:
      focusable - if the item should be focusable
      Since:
      4.12
    • builder

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