Top Description Constructors Methods
javafx.css

public abstract Class PseudoClass

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.javafx.css.PseudoClassImpl
Imports
com.sun.javafx.css.PseudoClassState

PseudoClass represents one unique pseudo-class state. Introducing a pseudo-class into a JavaFX class only requires that the method javafx.scene.Node#pseudoClassStateChanged(javafx.css.PseudoClass, boolean) be called when the pseudo-class state changes. Typically, the pseudoClassStateChanged method is called from the protected void invalidated() method of one of the property base classes in the javafx.beans.property package.

Note that if a node has a default pseudo-class state, a horizontal orientation for example, pseudoClassStateChanged should be called from the constructor to set the initial state.

The following example would allow "xyzzy" to be used as a pseudo-class in a CSS selector.


 public boolean isMagic() {
      return magic.get();
  }

  public BooleanProperty magicProperty() {
      return magic;
  }

  public BooleanProperty magic =
      new BooleanPropertyBase(false) {

      @Override protected void invalidated() {
          pseudoClassStateChanged(MAGIC_PSEUDO_CLASS, get());
      }

      @Override public Object getBean() {
          return MyControl.this;
      }

      @Override public String getName() {
          return "magic";
      }
  }

  private static final PseudoClass
      MAGIC_PSEUDO_CLASS = PseudoClass.getPseudoClass("xyzzy");
Since
JavaFX 8.0

Constructor Summary

AccessConstructor and Description
public
PseudoClass()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public static PseudoClass

Returns:

the PseudoClass instance for a given pseudo class name; It will not return null
getPseudoClass
(String
the name of the pseudo class
pseudoClass
)

Gets the PseudoClass instance for a given pseudo class name.

public abstract String

Returns:

the name of the PseudoClass
getPseudoClassName
()

Gets the name of the PseudoClass.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PseudoClassback to summary
public PseudoClass()

Constructor for subclasses to call.

Method Detail

getPseudoClassback to summary
public static PseudoClass getPseudoClass(String pseudoClass)

Gets the PseudoClass instance for a given pseudo class name.

Note

There is only one PseudoClass instance for a given pseudo class name.

Parameters
pseudoClass:String

the name of the pseudo class

Returns:PseudoClass

the PseudoClass instance for a given pseudo class name; It will not return null

Exceptions
IllegalArgumentException:
if pseudoClass parameter is null or an empty String
getPseudoClassNameback to summary
public abstract String getPseudoClassName()

Gets the name of the PseudoClass.

Returns:String

the name of the PseudoClass