Interface Selector
- All Known Subinterfaces:
BuiltinSelector
- All Known Implementing Classes:
Children
,ChildrenRecursive
,HasId
,IsClass
,NthElement
,Self
,Single
public interface Selector
A selector for an element in the tree. Similar to CSS selectors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Selector
children()
static Selector
static Selector
static Selector
childrenRecursive
(@Nullable Selector next) static Selector
static Selector
static Selector
nthElement
(int i) static Selector
nthElement
(int i, @Nullable Selector next) static Selector
static Selector
static Selector
parse
(StringCursor cursor) void
select
(@Nullable WidgetInstance element, Consumer<@NonNull WidgetInstance> consumer) default List
<@NonNull WidgetInstance<?>> selectAll
(@Nullable WidgetInstance<?> element) Selects all matching elements.default @Nullable WidgetInstance
selectFirst
(@Nullable WidgetInstance element) default @Nullable WidgetInstance
selectSingle
(@Nullable WidgetInstance element) static Selector
-
Method Details
-
select
- Parameters:
element
- the element that the selector is being applied to.
-
selectFirst
-
selectSingle
-
selectAll
Selects all matching elements. The returned list is mutable and owned by the caller. -
nthElement
-
nthElement
-
children
-
children
-
childrenRecursive
-
childrenRecursive
-
single
-
onlyChild
-
onlyChild
-
isClass
-
isClass
-
parse
- Throws:
SyntaxError
-