WidgetAddress

public 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

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