SelectableList

class SelectableList<E>(list: List<E>, selectedIndex: Int = -1) : List<E> , AutoCloseable(source)

A wrapper around a List that adds selection capability. This class provides a selectedIndex property and a selected property to get the currently selected item. It triggers a changed event whenever the selected index is modified.

Type Parameters

E

the type of elements in this list

Constructors

Link copied to clipboard
constructor(list: List<E>, selectedIndex: Int = -1)

Properties

Link copied to clipboard
val changed: Event<SelectableList<E>>
Link copied to clipboard
val selected: E?

The currently selected element, or null if no element is selected or the index is out of bounds.

Link copied to clipboard

The index of the currently selected element. Setting this property will trigger the changed event.

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open operator override fun contains(element: E): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): E
Link copied to clipboard
open override fun indexOf(element: E): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<E>
Link copied to clipboard
open override fun lastIndexOf(element: E): Int
Link copied to clipboard
open override fun listIterator(): ListIterator<E>
open override fun listIterator(index: Int): ListIterator<E>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<E>