Top Description Inners Fields Constructors Methods
javafx.css

public abstract Class Selector

extends Object
Class Inheritance
Known Direct Subclasses
javafx.css.SimpleSelector, javafx.css.CompoundSelector
Imports
com.sun.javafx.css.Combinator, java.io.DataInputStream, .DataOutputStream, .IOException, 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
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv
Selector()

Package scoped constructor.

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 heirarchy to look for
depth
)

Gets whether this Selector applies to the given Styleable.

public abstract 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.

pack-priv static Selector
pack-priv static Selector
readBinary(int
bss version identifier
bssVersion
,
DataInputStream
DataInputStream to read Selector data from
is
,
String[]
string array containing selector details
strings
)

Reads binary Selector data from a given DataInputStream.

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.

protected void
writeBinary(DataOutputStream
DataOutputStream to write Selector data to
os
,
StyleConverter.StringStore
unused
stringStore
)

Writes Selector data in binary form to given DataOutputStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ordinalback to summary
private int ordinal
ruleback to summary
private Rule rule
TYPE_COMPOUNDback to summary
private static final int TYPE_COMPOUND
TYPE_SIMPLEback to summary
private static final int TYPE_SIMPLE

Constructor Detail

Selectorback to summary
pack-priv Selector()

Package scoped constructor.

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 heirarchy to look for

Returns:boolean

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

createMatchback to summary
public abstract 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

getUniversalSelectorback to summary
pack-priv static Selector getUniversalSelector()
readBinaryback to summary
pack-priv static Selector readBinary(int bssVersion, DataInputStream is, String[] strings) throws IOException

Reads binary Selector data from a given DataInputStream.

Parameters
bssVersion:int

bss version identifier

is:DataInputStream

DataInputStream to read Selector data from

strings:String[]

string array containing selector details

Exceptions
IOException:
if reading from DataInputStream fails
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

writeBinaryback to summary
protected void writeBinary(DataOutputStream os, StyleConverter.StringStore stringStore) throws IOException

Writes Selector data in binary form to given DataOutputStream.

Parameters
os:DataOutputStream

DataOutputStream to write Selector data to

stringStore:StyleConverter.StringStore

unused

Exceptions
IOException:
if writing to DataOutputStream fails
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()