- java.lang.Object
-
- javafx.css.Selector
-
- javafx.css.CompoundSelector
-
public final class CompoundSelector extends Selector
A compound selector which behaves according to the CSS standard. The selector is composed of one or moreSelectors, along with an array ofCompoundSelectorRelationshipsindicating the required relationship at each stage. There must be exactly one lessCombinatorthan there are selectors.For example, the parameters
[selector1, selector2, selector3]and[Combinator.CHILD, Combinator.DESCENDANT]will match a component when all of the following conditions hold:- The component itself is matched by selector3
- The component has an ancestor which is matched by selector2
- The ancestor matched in step 2 is a direct CHILD of a component matched by selector1
selector1 > selector2 selector3. The greater-than (>) between selector1 and selector2 specifies a direct CHILD, whereas the whitespace between selector2 and selector3 corresponds toCombinator.DESCENDANT.- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplies(Styleable styleable)booleanapplies(Styleable styleable, Set<PseudoClass>[] triggerStates, int depth)MatchcreateMatch()booleanequals(Object obj)List<SimpleSelector>getSelectors()The selectors that make up this compound selectorinthashCode()booleanstateMatches(Styleable styleable, Set<PseudoClass> states)Determines whether the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector.StringtoString()protected voidwriteBinary(DataOutputStream os, StyleConverter.StringStore stringStore)-
Methods inherited from class javafx.css.Selector
createSelector, getOrdinal, getRule, setOrdinal
-
-
-
-
Method Detail
-
getSelectors
public List<SimpleSelector> getSelectors()
The selectors that make up this compound selector- Returns:
- Immutable List<SimpleSelector>
-
createMatch
public Match createMatch()
- Specified by:
createMatchin classSelector
-
applies
public boolean applies(Styleable styleable, Set<PseudoClass>[] triggerStates, int depth)
-
stateMatches
public boolean stateMatches(Styleable styleable, Set<PseudoClass> states)
Description copied from class:SelectorDetermines whether the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector.- Specified by:
stateMatchesin classSelector- Parameters:
styleable- the styleablestates- the state- Returns:
trueif the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector
-
writeBinary
protected final void writeBinary(DataOutputStream os, StyleConverter.StringStore stringStore) throws IOException
- Overrides:
writeBinaryin classSelector- Throws:
IOException
-
-