Klasse ListItem

Alle implementierten Schnittstellen:
PointerInterface
Bekannte direkte Unterklassen:
ColumnViewCell

public class ListItem extends PropertyHolder
Used by list widgets to represent items in a [iface@Gio.ListModel].

`GtkListItem` objects are managed by the list widget (with its factory)
and cannot be created by applications, but they need to be populated
by application code. This is done by calling [method@Gtk.ListItem.set_child].

`GtkListItem` objects 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 [property@Gtk.ListItem:item]
property is set to %NULL.

2. The bound stage where the listitem references an item from the list.
The [property@Gtk.ListItem:item] property is not %NULL.

https://docs.gtk.org/gtk4/class.ListItem.html

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAccessibleDescription

      public Str getAccessibleDescription()
      Gets the accessible description of @self.
      Gibt zurück:
      the accessible description
    • getAccessibleLabel

      public Str getAccessibleLabel()
      Gets the accessible label of @self.
      Gibt zurück:
      the accessible label
    • getActivatable

      public boolean getActivatable()
      Checks if a list item has been set to be activatable via
      gtk_list_item_set_activatable().
      Gibt zurück:
      %TRUE if the item is activatable
    • getChild

      public Widget getChild()
      Gets the child previously set via gtk_list_item_set_child() or
      %NULL if none was set.
      Gibt zurück:
      The child
    • getFocusable

      public boolean getFocusable()
      Checks if a list item has been set to be focusable via
      gtk_list_item_set_focusable().
      Gibt zurück:
      %TRUE if the item is focusable
    • getItem

      public Pointer getItem()
      Gets the model item that associated with @self.

      If @self is unbound, this function returns %NULL.
      Gibt zurück:
      The item displayed
    • getPosition

      public int getPosition()
      Gets the position in the model that @self currently displays.

      If @self is unbound, %GTK_INVALID_LIST_POSITION is returned.
      Gibt zurück:
      The position of this item
    • getSelectable

      public boolean getSelectable()
      Checks if a list item has been set to be selectable via
      gtk_list_item_set_selectable().

      Do not confuse this function with [method@Gtk.ListItem.get_selected].
      Gibt zurück:
      %TRUE if the item is selectable
    • 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.
      Gibt zurück:
      %TRUE if the item is selected.
    • setAccessibleDescription

      public void setAccessibleDescription(@Nonnull Str description)
      Sets the accessible description for the list item,
      which may be used by e.g. screen readers.
      Parameter:
      description - the description
    • setAccessibleDescription

      public void setAccessibleDescription(String description)
      Sets the accessible description for the list item,
      which may be used by e.g. screen readers.
      Parameter:
      description - the description
    • setAccessibleLabel

      public void setAccessibleLabel(@Nonnull Str label)
      Sets the accessible label for the list item,
      which may be used by e.g. screen readers.
      Parameter:
      label - the label
    • setAccessibleLabel

      public void setAccessibleLabel(String label)
      Sets the accessible label for the list item,
      which may be used by e.g. screen readers.
      Parameter:
      label - the label
    • setActivatable

      public void setActivatable(boolean activatable)
      Sets @self to be activatable.

      If an item is activatable, double-clicking on the item, using
      the Return key or calling gtk_widget_activate() will activate
      the item. Activating instructs the containing view to handle
      activation. `GtkListView` for example will be emitting the
      [signal@Gtk.ListView::activate] signal.

      By default, list items are activatable.
      Parameter:
      activatable - if the item should be activatable
    • 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.
      Parameter:
      child - The list item's child or %NULL to unset
    • setFocusable

      public void setFocusable(boolean focusable)
      Sets @self to be focusable.

      If an item is focusable, it can be focused using the keyboard.
      This works similar to [method@Gtk.Widget.set_focusable].

      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.
      Parameter:
      focusable - if the item should be focusable
    • setSelectable

      public void setSelectable(boolean selectable)
      Sets @self to be selectable.

      If an item is selectable, clicking on the item or using the keyboard
      will try to select or unselect the item. If this succeeds is up to
      the model to determine, as it is managing the selected state.

      Note that this means that making an item non-selectable has no
      influence on the selected state at all. A non-selectable item
      may still be selected.

      By default, list items are selectable. When rebinding them to
      a new item, they will also be reset to be selectable by GTK.
      Parameter:
      selectable - if the item should be selectable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()