Creates a JavaFX CssMetaData instance that can be used in the Skin of a Control. - Java JavaFX

Java examples for JavaFX:CSS

Description

Creates a JavaFX CssMetaData instance that can be used in the Skin of a Control.

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{
    /**// w  w w .j  ava2  s .  co m
     * Creates a CssMetaData instance that can be used in the Skin of a Control.
     *
     * @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 Skin class
     * @param defaultValue The default value of the corresponding StyleableProperty
     * @param <S> Type of the Control
     * @param <V> Value type of the property
     * @return the CssMetaData instance
     */
    public static <S extends Control, V> SkinPropertyBasedCssMetaData<S, V> createSkinMetaData(
            String property, StyleConverter<?, V> converter,
            String propertyName, V defaultValue) {
        return new SkinPropertyBasedCssMetaData<S, V>(property, converter,
                propertyName, defaultValue);
    }
}

Related Tutorials