APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.css

public abstract sealed Class Selector

extends Object
permits SimpleSelector, CompoundSelector
Class Inheritance
Known Direct Subclasses
com.sun.javafx.css.CompoundSelector, com.sun.javafx.css.SimpleSelector
Imports
com.sun.javafx.css.Combinator, .CompoundSelector, .SimpleSelector, java.util.ArrayList, .List, .Set

Used by CSSRule to determine whether or not the Selector applies to a given object.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private Rule

Constructor Summary

AccessConstructor and Description
protected
Selector()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

true if this Selector applies to the given Styleable
applies
(Styleable
the Styleable to match
styleable
)

Gets whether this Selector applies to the given Styleable.

public abstract boolean

Returns:

true if this Selector and a set of PseudoClass applies to the given Styleable
applies
(Styleable
the Styleable to match
styleable
,
Set<PseudoClass>[]
a set of PseudoClass states
triggerStates
,
int
depth of the Node hierarchy to look for
depth
)

Gets whether this Selector applies to the given Styleable.

public final Match

Returns:

a match, never null
createMatch
()

Creates a Match.

public static Selector

Returns:

a Selector
createSelector
(final String
CSS selector string
cssSelector
)

Creates a Selector object.

public int

Returns:

the ordinal of this Selector
getOrdinal
()

Gets the ordinal of this Selector.

public Rule

Returns:

rule
getRule
()

Gets the Rule of this Selector.

public abstract Set<String>

Returns:

an immutable set with style class names, never null, or contains nulls, but can be empty
getStyleClassNames
()

Gets the immutable set of style class names of this Selector.

pack-priv static Selector
public void
setOrdinal(int
the ordinal of this Selector
ordinal
)

Sets the ordinal of this Selector.

pack-priv void
setRule(Rule
the Rule of this Selector
rule
)

Sets the Rule of this Selector.

public abstract boolean

Returns:

true if the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector
stateMatches
(Styleable
the styleable
styleable
,
Set<PseudoClass>
the state
state
)

Determines whether the current state of the Node and its parents matches the pseudo-classes defined (if any) for this selector.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ordinalback to summary
private int ordinal
ruleback to summary
private Rule rule

Constructor Detail

Selectorback to summary
protected Selector()

Constructor for subclasses to call.

Since
24

Method Detail

appliesback to summary
public abstract boolean applies(Styleable styleable)

Gets whether this Selector applies to the given Styleable.

Parameters
styleable:Styleable

the Styleable to match

Returns:boolean

true if this Selector applies to the given Styleable

appliesback to summary
public abstract boolean applies(Styleable styleable, Set<PseudoClass>[] triggerStates, int depth)

Gets whether this Selector applies to the given Styleable. It is the same as the applies(Styleable) method except it also returns PseudoClass state that it finds along the way.

Parameters
styleable:Styleable

the Styleable to match

triggerStates:Set<PseudoClass>[]

a set of PseudoClass states

depth:int

depth of the Node hierarchy to look for

Returns:boolean

true if this Selector and a set of PseudoClass applies to the given Styleable

createMatchback to summary
public final Match createMatch()

Creates a Match.

Returns:Match

a match, never null

createSelectorback to summary
public static Selector createSelector(final String cssSelector)

Creates a Selector object.

Parameters
cssSelector:String

CSS selector string

Returns:Selector

a Selector

getOrdinalback to summary
public int getOrdinal()

Gets the ordinal of this Selector.

Returns:int

the ordinal of this Selector

getRuleback to summary
public Rule getRule()

Gets the Rule of this Selector.

Returns:Rule

rule

getStyleClassNamesback to summary
public abstract Set<String> getStyleClassNames()

Gets the immutable set of style class names of this Selector.

Returns:Set<String>

an immutable set with style class names, never null, or contains nulls, but can be empty

Since
23
getUniversalSelectorback to summary
pack-priv static Selector getUniversalSelector()
setOrdinalback to summary
public void setOrdinal(int ordinal)

Sets the ordinal of this Selector.

Parameters
ordinal:int

the ordinal of this Selector

setRuleback to summary
pack-priv void setRule(Rule rule)

Sets the Rule of this Selector.

Parameters
rule:Rule

the Rule of this Selector

stateMatchesback to summary
public abstract boolean stateMatches(Styleable styleable, Set<PseudoClass> state)

Determines whether the current state of the Node and its parents matches the pseudo-classes defined (if any) for this selector.

Parameters
styleable:Styleable

the styleable

state:Set<PseudoClass>

the state

Returns:boolean

true if the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector

javafx.css back to summary

private Class Selector.UniversalSelector

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final Selector

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final Selector INSTANCE

Constructor Detail

UniversalSelectorback to summary
private UniversalSelector()