List

open class List<T, out M : ListModel<T>>(val model: M, val itemVisualizer: ItemVisualizer<T, IndexedItem>? = null, val selectionModel: SelectionModel<Int>? = null, fitContent: Set<Dimension> = setOf(Width, Height), scrollCache: Int = 0) : View, ListLike, Selectable<Int> (source)

A visual component that renders an immutable list of items of type T using a ListBehavior. Items are obtained via the model and selection is managed via the optional selectionModel. Large ("infinite") lists are supported efficiently, since List recycles the Views generated to render its items.

Note that this class assumes the given ListModel is immutable and will not automatically respond to changes in the model. See DynamicList or MutableList if this behavior is desirable.

List does not provide scrolling internally, so it should be embedded in a ScrollPanel or similar component if needed.

Parameters

model

that holds the data for this List

itemVisualizer

that maps T to View for each item in the List

selectionModel

that manages the List's selection state

fitContent

determines whether the List scales to fit its items' width or total height

scrollCache

determining how many "hidden" items are rendered above and below the List's view-port. A value of 0 means only visible items are rendered, but quick scrolling is more likely to show blank areas.

Inheritors

Constructors

Link copied to clipboard
constructor(model: M, itemVisualizer: ItemVisualizer<T, IndexedItem>? = null, selectionModel: SelectionModel<Int>? = null, fitContent: Set<Dimension> = setOf(Width, Height), scrollCache: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Controls how the List behaves and how its items are rendered. A List will not render without a behavior specified.

Link copied to clipboard
Link copied to clipboard
override var bounds: Rectangle
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Defines how the contents of an item should be aligned within it.

Link copied to clipboard
protected open val children: ObservableList<View>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val firstSelectable: Int?
Link copied to clipboard
open override val firstSelection: Int?
Link copied to clipboard
protected var firstVisibleItem: Int
Link copied to clipboard
open var focusable: Boolean
Link copied to clipboard
Link copied to clipboard
protected val focusCycleRoot: View?
Link copied to clipboard
Link copied to clipboard
var font: Font?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override var height: Double
Link copied to clipboard
override var idealSize: Size?
Link copied to clipboard
open override var insets: Insets
Link copied to clipboard
Link copied to clipboard
open override var isFocusCycleRoot: Boolean
Link copied to clipboard

that maps T to View for each item in the List

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val lastSelectable: Int?
Link copied to clipboard
open override val lastSelection: Int?
Link copied to clipboard
protected var lastVisibleItem: Int
Link copied to clipboard
protected open var layout: Layout?
Link copied to clipboard
override var minimumSize: Size
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected open val model: M

that holds the data for this List

Link copied to clipboard
Link copied to clipboard
open override val numItems: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var parent: View?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override var position: Point
Link copied to clipboard
Link copied to clipboard
open override val selection: Set<Int>
Link copied to clipboard
open override val selectionAnchor: Int?
Link copied to clipboard

Notifies of changes to the List's selection.

Link copied to clipboard
protected val selectionModel: SelectionModel<Int>? = null

that manages the List's selection state only visible items are rendered, but quick scrolling is more likely to show blank areas.

Link copied to clipboard
override var size: Size
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override var visible: Boolean
Link copied to clipboard
override var width: Double
Link copied to clipboard
override var x: Double
Link copied to clipboard
override var y: Double
Link copied to clipboard
var zOrder: Int

Functions

Link copied to clipboard
protected open override fun addedToDisplay()
Link copied to clipboard
open override fun addSelection(items: Set<Int>)
Link copied to clipboard
protected open infix fun ancestorOf(view: View): Boolean
Link copied to clipboard
protected open fun child(at: Point): View?
Link copied to clipboard
open override fun clearSelection()
Link copied to clipboard
fun contains(value: T): Boolean
protected operator fun contains(child: View): Boolean
open operator override fun contains(point: Point): Boolean
Link copied to clipboard
protected fun contentDirectionChanged()
Link copied to clipboard
protected fun cursorChanged(old: Cursor?, new: Cursor?)
Link copied to clipboard
protected open fun doLayout()
Link copied to clipboard
protected fun enabledChanged(old: Boolean, new: Boolean, filter: (View) -> Boolean)
Link copied to clipboard
protected open fun filterKeyEvent(event: KeyEvent)
Link copied to clipboard
protected open fun filterPointerEvent(event: PointerEvent)
Link copied to clipboard
protected open fun filterPointerMotionEvent(event: PointerEvent)
Link copied to clipboard
fun fromAbsolute(point: Point): Point
Link copied to clipboard
operator fun get(index: Int): Result<T>

Returns the item at index if one exists, null otherwise.

operator fun get(traversalType: FocusTraversalPolicy.TraversalType): Set<KeyState>?
Link copied to clipboard
protected open override fun handleDisplayRectEvent(old: Rectangle, new: Rectangle)
Link copied to clipboard
protected open fun handleKeyEvent(event: KeyEvent)
Link copied to clipboard
protected open fun handlePointerEvent(event: PointerEvent)
Link copied to clipboard
protected open fun handlePointerMotionEvent(event: PointerEvent)
Link copied to clipboard
open infix fun intersects(point: Point): Boolean
Link copied to clipboard
protected fun layout(view: View, item: T, index: Int)
Link copied to clipboard
open override fun next(after: Int): Int?
Link copied to clipboard
open override fun previous(before: Int): Int?
Link copied to clipboard
protected open fun relayout()
Link copied to clipboard
protected open override fun removedFromDisplay()
Link copied to clipboard
open override fun removeSelection(items: Set<Int>)
Link copied to clipboard
open override fun render(canvas: Canvas)
Link copied to clipboard
fun rerender()
Link copied to clipboard
Link copied to clipboard
protected fun revalidate()
Link copied to clipboard
fun scrollTo(item: Int)

Scrolls item into view if the List is within a ScrollPanel.

Link copied to clipboard

Scrolls the last selected item into view if the List is within a ScrollPanel.

Link copied to clipboard
open override fun selectAll()
Link copied to clipboard
open override fun selected(item: Int): Boolean
Link copied to clipboard
operator fun set(traversalType: FocusTraversalPolicy.TraversalType, keyStates: Set<KeyState>?)
Link copied to clipboard
open override fun setSelection(items: Set<Int>)
Link copied to clipboard
protected open fun shouldHandlePointerEvent(event: PointerEvent): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected fun styleChanged(filter: (View) -> Boolean)
Link copied to clipboard
fun toAbsolute(point: Point): Point
Link copied to clipboard
open override fun toggleSelection(items: Set<Int>)
Link copied to clipboard
fun toLocal(point: Point, from: View?): Point
Link copied to clipboard
Link copied to clipboard
fun toParent(point: Point): Point
Link copied to clipboard
protected fun update(children: MutableList<View>, index: Int)
Link copied to clipboard
protected fun updateVisibleHeight()