Top Description Fields Constructors Methods
org.controlsfx.control.decoration

public Class StyleClassDecoration

extends Decoration
Class Inheritance
Imports
java.util.List, javafx.scene.Node

StyleClassDecoration is a Decoration designed to add a CSS style class to a node (for example, to show a warning style when the field is incorrectly set). StyleClassDecoration is applied as part of the ControlsFX Decorator API - refer to the Decorator javadoc for more details.
See Also
Decoration, Decorator

Field Summary

Modifier and TypeField and Description
private final String[]

Constructor Summary

AccessConstructor and Description
public
StyleClassDecoration(String...
A var-args array of style classes to apply to any node.
styleClass
)

Constructs a new StyleClassDecoration with the given var-args array of style classes set to be applied to any node that has this decoration applied to it.

Method Summary

Modifier and TypeMethod and Description
public Node
applyDecoration(Node targetNode)

Implements abstract org.controlsfx.control.decoration.Decoration.applyDecoration.

This method decorates the given target node with the relevant decorations, returning any 'decoration node' that needs to be added to the scenegraph (although this can be null).

public void
removeDecoration(Node targetNode)

Implements abstract org.controlsfx.control.decoration.Decoration.removeDecoration.

This method removes the decoration from the given target node.

Inherited from org.controlsfx.control.decoration.Decoration:
getProperties

Field Detail

styleClassesback to summary
private final String[] styleClasses

Constructor Detail

StyleClassDecorationback to summary
public StyleClassDecoration(String... styleClass)

Constructs a new StyleClassDecoration with the given var-args array of style classes set to be applied to any node that has this decoration applied to it.

Parameters
styleClass:String[]

A var-args array of style classes to apply to any node.

Exceptions
IllegalArgumentException:
if the styleClass varargs array is null or empty.

Method Detail

applyDecorationback to summary
public Node applyDecoration(Node targetNode)

Implements abstract org.controlsfx.control.decoration.Decoration.applyDecoration.

Doc from org.controlsfx.control.decoration.Decoration.applyDecoration.

This method decorates the given target node with the relevant decorations, returning any 'decoration node' that needs to be added to the scenegraph (although this can be null). When the returned Node is null, this indicates that the decoration will be handled internally by the decoration (which is preferred, as the default implementation is not ideal in most circumstances).

When the boolean parameter is false, this method removes the decoration from the given target node, always returning null.

Annotations
@Override
removeDecorationback to summary
public void removeDecoration(Node targetNode)

Implements abstract org.controlsfx.control.decoration.Decoration.removeDecoration.

Doc from org.controlsfx.control.decoration.Decoration.removeDecoration.

This method removes the decoration from the given target node.

Annotations
@Override