Class GuiSelector
java.lang.Object
com.render.api.gui.style.GuiSelector
Immutable typed selector matched against retained components and pseudo-elements.
Relationship methods read from the selected subject toward an earlier selector:
GuiSelector.styleClass("item").childOf(GuiSelector.styleClass("list")).
-
Method Summary
Modifier and TypeMethodDescriptionadjacentSiblingOf(GuiSelector previousSibling) static GuiSelectorany()Creates a selector matching any ordinary component.<T> GuiSelectorattribute(GuiStyleAttribute<T> attribute) <T> GuiSelectorattribute(GuiStyleAttribute<T> attribute, Predicate<? super T> predicate) <T> GuiSelectorattributeEquals(GuiStyleAttribute<T> attribute, T expected) childOf(GuiSelector parent) customState(String state) descendantOf(GuiSelector ancestor) static GuiSelectorCreates an ID selector.booleanmatches(GuiComponent<?> component) Tests this selector against an ordinary component.booleanmatches(GuiComponent<?> component, GuiPseudoElement targetPseudoElement) Tests this selector against a component-originated pseudo-element.nthChild(int a, int b) Adds anan+bchild-position condition.nthOfType(int a, int b) Adds anan+bsame-type position condition.ofType(Class<? extends GuiComponent<?>> type) pseudoClass(GuiPseudoClass pseudoClass) pseudoElement(GuiPseudoElement pseudoElement) Returns the selected pseudo-element, ornullfor an ordinary component selector.siblingOf(GuiSelector earlierSibling) Returns the selector specificity.static GuiSelectorstyleClass(String styleClass) Creates a style-class selector.static GuiSelectortype(Class<? extends GuiComponent<?>> type) Creates a component-type selector.
-
Method Details
-
any
Creates a selector matching any ordinary component.- Returns:
- selector
-
type
Creates a component-type selector.- Parameters:
type- component base or concrete type- Returns:
- selector
-
id
Creates an ID selector.- Parameters:
id- component ID- Returns:
- selector
-
styleClass
Creates a style-class selector.- Parameters:
styleClass- style class- Returns:
- selector
-
ofType
-
withId
-
withClass
-
attribute
-
attributeEquals
-
attribute
-
pseudoClass
-
customState
-
nthChild
Adds anan+bchild-position condition.- Parameters:
a- cycle size, or zero for an exact positionb- one-based offset- Returns:
- selector
-
nthOfType
Adds anan+bsame-type position condition.- Parameters:
a- cycle size, or zero for an exact positionb- one-based offset- Returns:
- selector
-
pseudoElement
-
childOf
-
descendantOf
-
adjacentSiblingOf
-
siblingOf
-
specificity
-
selectedPseudoElement
Returns the selected pseudo-element, ornullfor an ordinary component selector.- Returns:
- pseudo-element target
-
matches
Tests this selector against an ordinary component.- Parameters:
component- component- Returns:
- match result
-
matches
Tests this selector against a component-originated pseudo-element.- Parameters:
component- originating componenttargetPseudoElement- target pseudo-element, ornull- Returns:
- match result
-