All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mvysny.kaributesting.v10.ListBox.kt Maven / Gradle / Ivy

There is a newer version: 2.1.8
Show newest version
package com.github.mvysny.kaributesting.v10

import com.vaadin.flow.component.listbox.ListBoxBase
import com.vaadin.flow.data.provider.DataProvider
import java.lang.reflect.Method

/**
 * Fetches renderings of items currently displayed in the list box component.
 */
public fun  ListBoxBase<*, T, *>.getRenderedItems(): List {
    val items: List = getItems()
    return items.map { itemRenderer._getPresentationValue(it) }
}

/**
 * Fetches all items currently displayed in the list box component.
 */
public fun  ListBoxBase<*, T, *>.getItems(): List = dataProvider._findAll()

private val __ListBoxBase_getDataProvider: Method by lazy(LazyThreadSafetyMode.PUBLICATION) {
    val m = ListBoxBase::class.java.getDeclaredMethod("getDataProvider")
    m.isAccessible = true
    m
}

/**
 * `ListBoxBase.getDataProvider()` is private since Vaadin 24.0.0.beta1
 */
@Suppress("UNCHECKED_CAST")
public val  ListBoxBase<*, T, *>.dataProvider: DataProvider
    get() = __ListBoxBase_getDataProvider.invoke(this) as DataProvider




© 2015 - 2024 Weber Informatics LLC | Privacy Policy