create JavaFX CSS Property - Java JavaFX

Java examples for JavaFX:CSS

Description

create JavaFX CSS Property

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{
    public static <S extends Styleable, V> StyleableObjectProperty<V> createProperty(
            DefaultPropertyBasedCssMetaData<S, V> metaData, S styleable) {
        return new SimpleStyleableObjectProperty<V>(metaData, styleable,
                metaData.getPropertyName(),
                metaData.getInitialValue(styleable));
    }//  w  ww  .java2  s.c o  m
    public static <S extends Control, V> StyleableObjectProperty<V> createProperty(
            SkinPropertyBasedCssMetaData<S, V> metaData, SkinBase<S> skin) {
        return new SimpleStyleableObjectProperty<V>(metaData, skin,
                metaData.getPropertyName(), metaData.getInitialValue(skin
                        .getSkinnable()));
    }
}

Related Tutorials