Creates a JavaFX CssMetaData instance that can be used in a Styleable class. - Java JavaFX

Java examples for JavaFX:CSS

Description

Creates a JavaFX CssMetaData instance that can be used in a Styleable class.

Demo Code


import javafx.css.*;
import javafx.scene.control.Control;
import javafx.scene.control.SkinBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main{
    /**//from   www.  ja  v a  2  s  . c om
     * Creates a CssMetaData instance that can be used in a Styleable class.
     *
     * @param property name of the CSS property
     * @param converter the StyleConverter used to convert the CSS parsed value to a Java object.
     * @param propertyName Name of the property field in the Styleable class
     * @param defaultValue The default value of the corresponding StyleableProperty
     * @param <S> Type of the Styleable instance
     * @param <V> Value type of the property
     * @return the CssMetaData instance
     */
    public static <S extends Styleable, V> DefaultPropertyBasedCssMetaData<S, V> createMetaData(
            String property, StyleConverter<?, V> converter,
            String propertyName, V defaultValue) {
        return new DefaultPropertyBasedCssMetaData<S, V>(property,
                converter, propertyName, defaultValue);
    }
}

Related Tutorials