ListItemScope

sealed interface ListItemScope

The receiver of the composable cell body a ListCellRenderer stamps a row through: the three values the widget hands a ListCellRenderer for the row being stamped, exposed as read-only composition state so the cell can lay itself out by index, selection, and focus. A ListBox or ComboBox item cell is one such body, as is one a caller writes over their own JList or JComboBox with rememberListItemRenderer.

Mirrors the arguments of javax.swing.ListCellRenderer.getListCellRendererComponent: index is the row, isSelected whether that row is selected, cellHasFocus whether it currently draws the focus decoration.

See also

Properties

Link copied to clipboard
abstract val cellHasFocus: Boolean

Whether the row being rendered currently draws the focus decoration.

Link copied to clipboard
abstract val index: Int

The row index being rendered; -1 when a JComboBox renders its selected-value display area, per Swing's own ListCellRenderer convention.

Link copied to clipboard
abstract val isSelected: Boolean

Whether the row being rendered is selected.