java.lang.Object
javafx.css.Selector
- Direct Known Subclasses:
CompoundSelector
,SimpleSelector
Used by
CSSRule
to determine whether or not the Selector
applies to a
given object.- Since:
- 9
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Gets whether thisSelector
applies to the givenStyleable
.abstract boolean
applies
(Styleable styleable, Set<PseudoClass>[] triggerStates, int depth) Gets whether thisSelector
applies to the givenStyleable
.abstract Match
Creates aMatch
.static Selector
createSelector
(String cssSelector) Creates aSelector
object.int
Gets the ordinal of this Selector.getRule()
Gets theRule
of this Selector.void
setOrdinal
(int ordinal) Sets the ordinal of this Selector.abstract boolean
stateMatches
(Styleable styleable, Set<PseudoClass> state) Determines whether the current state of theNode
and its parents matches the pseudo-classes defined (if any) for this selector.protected void
writeBinary
(DataOutputStream os, StyleConverter.StringStore stringStore) WritesSelector
data in binary form to givenDataOutputStream
.
-
Method Details
-
getRule
Gets theRule
of this Selector.- Returns:
- rule
-
setOrdinal
public void setOrdinal(int ordinal) Sets the ordinal of this Selector.- Parameters:
ordinal
- the ordinal of this Selector
-
getOrdinal
public int getOrdinal()Gets the ordinal of this Selector.- Returns:
- the ordinal of this Selector
-
createMatch
Creates aMatch
.- Returns:
- a match, never
null
-
applies
Gets whether thisSelector
applies to the givenStyleable
.- Parameters:
styleable
- theStyleable
to match- Returns:
true
if thisSelector
applies to the givenStyleable
-
applies
Gets whether thisSelector
applies to the givenStyleable
. It is the same as theapplies(javafx.css.Styleable)
method except it also returnsPseudoClass
state that it finds along the way.- Parameters:
styleable
- theStyleable
to matchtriggerStates
- a set ofPseudoClass
statesdepth
- depth of theNode
heirarchy to look for- Returns:
true
if thisSelector
and a set ofPseudoClass
applies to the givenStyleable
-
stateMatches
Determines whether the current state of theNode
and its parents matches the pseudo-classes defined (if any) for this selector.- Parameters:
styleable
- the styleablestate
- the state- Returns:
true
if the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector
-
writeBinary
protected void writeBinary(DataOutputStream os, StyleConverter.StringStore stringStore) throws IOException WritesSelector
data in binary form to givenDataOutputStream
.- Parameters:
os
-DataOutputStream
to writeSelector
data tostringStore
- unused- Throws:
IOException
- if writing toDataOutputStream
fails
-
createSelector
Creates aSelector
object.- Parameters:
cssSelector
- CSS selector string- Returns:
- a
Selector
-