APIdia Launch Partner
Top Description Methods
javafx.css

public Interface Styleable

Known Direct Implementers
javafx.scene.Node
Imports
java.util.List, javafx.collections.ObservableList, .ObservableSet, javafx.scene.Node

Styleable comprises the minimal interface required for an object to be styled by CSS.
Since
JavaFX 8.0
See Also
CSS Reference Guide

Method Summary

Modifier and TypeMethod and Description
public List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData
getCssMetaData
()

The CssMetaData of this Styleable.

public String

Returns:

the id of this Styleable
getId
()

The id of this Styleable.

public ObservableSet<PseudoClass>

Returns:

the pseudo-class state
getPseudoClassStates
()

Return the pseudo-class state of this Styleable.

public String

Returns:

a string representation of the CSS style associated with this specific Node
getStyle
()

A string representation of the CSS style associated with this specific Node.

public default Node

Returns:

the Node that represents this Styleable object
getStyleableNode
()

Returns the Node that represents this Styleable object.

public Styleable

Returns:

the parent of this Styleable, or null if there is no parent
getStyleableParent
()

Return the parent of this Styleable, or null if there is no parent.

public ObservableList<String>

Returns:

a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine
getStyleClass
()

A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine.

public String

Returns:

the type of this Styleable
getTypeSelector
()

The type of this Styleable that is to be used in selector matching.

Method Detail

getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

The CssMetaData of this Styleable. This may be returned as an unmodifiable list.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData

getIdback to summary
public String getId()

The id of this Styleable. This simple string identifier is useful for finding a specific Node within the scene graph. While the id of a Node should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).

For example, if a Node is given the id of "myId", then the lookup method can be used to find this node as follows: scene.lookup("#myId");.

Returns:String

the id of this Styleable

getPseudoClassStatesback to summary
public ObservableSet<PseudoClass> getPseudoClassStates()

Return the pseudo-class state of this Styleable. CSS assumes this set is read-only.

Returns:ObservableSet<PseudoClass>

the pseudo-class state

getStyleback to summary
public String getStyle()

A string representation of the CSS style associated with this specific Node. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.

Returns:String

a string representation of the CSS style associated with this specific Node

getStyleableNodeback to summary
public default Node getStyleableNode()

Returns the Node that represents this Styleable object. This method should be overridden in cases where the Styleable is not itself a Node, so that it may optionally return the relevant root node representation of itself. By default this method returns null, which can mean that either the Styleable itself is a Node, or if that is not the case, that the Styleable does not have a node representation available at the time of request.

Returns:Node

the Node that represents this Styleable object

Since
9
getStyleableParentback to summary
public Styleable getStyleableParent()

Return the parent of this Styleable, or null if there is no parent.

Returns:Styleable

the parent of this Styleable, or null if there is no parent

getStyleClassback to summary
public ObservableList<String> getStyleClass()

A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. This variable is analogous to the "class" attribute on an HTML element and, as such, each element of the list is a style class to which this Node belongs.

Returns:ObservableList<String>

a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine

See Also
CSS3 class selectors
getTypeSelectorback to summary
public String getTypeSelector()

The type of this Styleable that is to be used in selector matching. This is analogous to an "element" in HTML. (CSS Type Selector).

Returns:String

the type of this Styleable