Package javafx.css

Class SimpleSelector

java.lang.Object
javafx.css.Selector
javafx.css.SimpleSelector

public final class SimpleSelector extends Selector
A simple selector which behaves according to the CSS standard.
Since:
9
  • Method Details

    • getName

      public String getName()
      Gets the name of the java class to which this selector is applied, or *.
      Returns:
      the name of the java class
    • getStyleClasses

      public List<String> getStyleClasses()
      Gets an immutable list of style-classes of the Selector.
      Returns:
      an immutable list of style-classes of the Selector
    • getStyleClassSet

      public Set<StyleClass> getStyleClassSet()
      Gets the immutable Set of StyleClasses of the Selector.
      Returns:
      the Set of StyleClasses
    • getId

      public String getId()
      Gets the value of the selector id.
      Returns:
      the value of the selector id, which may be an empty string
    • getNodeOrientation

      public NodeOrientation getNodeOrientation()
      Gets the NodeOrientation of this Selector.
      Returns:
      the NodeOrientation
    • createMatch

      public Match createMatch()
      Description copied from class: Selector
      Creates a Match.
      Specified by:
      createMatch in class Selector
      Returns:
      a match, never null
    • applies

      public boolean applies(Styleable styleable)
      Description copied from class: Selector
      Gets whether this Selector applies to the given Styleable.
      Specified by:
      applies in class Selector
      Parameters:
      styleable - the Styleable to match
      Returns:
      true if this Selector applies to the given Styleable
    • applies

      public boolean applies(Styleable styleable, Set<PseudoClass>[] pseudoClasses, int depth)
      Description copied from class: Selector
      Gets whether this Selector applies to the given Styleable. It is the same as the Selector.applies(javafx.css.Styleable) method except it also returns PseudoClass state that it finds along the way.
      Specified by:
      applies in class Selector
      Parameters:
      styleable - the Styleable to match
      pseudoClasses - a set of PseudoClass states
      depth - depth of the Node heirarchy to look for
      Returns:
      true if this Selector and a set of PseudoClass applies to the given Styleable
    • stateMatches

      public boolean stateMatches(Styleable styleable, Set<PseudoClass> states)
      Description copied from class: Selector
      Determines whether the current state of the Node and its parents matches the pseudo-classes defined (if any) for this selector.
      Specified by:
      stateMatches in class Selector
      Parameters:
      styleable - the styleable
      states - the state
      Returns:
      true if the current state of the node and its parents matches the pseudo-classes defined (if any) for this selector
    • toString

      public String toString()
      Converts this object to a string.
      Overrides:
      toString in class Object
    • writeBinary

      protected final void writeBinary(DataOutputStream os, StyleConverter.StringStore stringStore) throws IOException
      Description copied from class: Selector
      Writes Selector data in binary form to given DataOutputStream.
      Overrides:
      writeBinary in class Selector
      Parameters:
      os - DataOutputStream to write Selector data to
      stringStore - unused
      Throws:
      IOException - if writing to DataOutputStream fails