fetch

fun fetch(): T

Resolves the matched component and returns it as the T the query named, for driving the component's own API directly (e.g. a JTable's model, a JTree's selection, a JList's model). A query that named the type does not name it again:

val table = onNodeOfType<JTable>().fetch()

Throws

if the query has no single target.


@JvmName(name = "fetchOfType")
inline fun <R : Component> fetch(): R

Resolves the matched component and returns it typed as R, for a query that named no type of its own, or that named a wider one than the component to be driven.

onNodeWithText("Save").fetch<JButton>().isDefaultCapable

Throws

if the query has no single target, or if the target is not an R.