public abstract class PseudoClass extends Object
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");
Constructor and Description |
---|
PseudoClass() |
Modifier and Type | Method and Description |
---|---|
static PseudoClass |
getPseudoClass(String pseudoClass)
There is only one PseudoClass instance for a given pseudoClass.
|
abstract String |
getPseudoClassName() |
public static PseudoClass getPseudoClass(String pseudoClass)
IllegalArgumentException
- if pseudoClass parameter is null or an empty Stringpublic abstract String getPseudoClassName()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.