WidgetAddress

open class WidgetAddress

Contains an "address" (the index path) for a widget to avoid avoid hardcoding the indexes. This will dynamically resolve the widget and cache the index path. The cached index path will be used for subsequent lookups.

Functions

Link copied to clipboard
open fun create(masterInterfaceFilter: Predicate<Widget>): WidgetAddress
Creates a widget address by searching all widgets with the specified predicate.
open fun create(getInterfaceFunc: Supplier<Optional<Widget>>): WidgetAddress
Creates a widget address using the specified supplier
open fun create(rootIndex: Int, componentFilter: Predicate<Widget>): WidgetAddress
Creates a widget address by searching all widgets in the specified root index with the specified predicate.
Link copied to clipboard
open fun getIndexPath(): Array<Int>
Gets the index path of this address
Link copied to clipboard
open fun lookup(): Optional<Widget>
Attempts to look up the widget, using the cached indexes if it exists, otherwise performs a dynamic lookup and attempts to check the widget.