Spec-Zone.ru › OpenJavaFX 8
javafx.css

Class StyleablePropertyFactory<S extends Styleable>

java.lang.Object
  • javafx.css.StyleablePropertyFactory<S>

Type Parameters:

S - The type of Styleable



public class StyleablePropertyFactory<S extends Styleable>
extends Object
Methods for creating instances of StyleableProperty with corresponding CssMetaData created behind the scenes. These methods greatly reduce the amount of boiler-plate code needed to implement the StyleableProperty and CssMetaData. These methods take a Function<? extends Styleable, StyleableProperty<?>> which returns a reference to the property itself. See the example below. Note that for efficient use of memory and for better CSS performance, creating the StyleablePropertyFactory as a static member, as shown below, is recommended.
public final class MyButton extends Button {

     private static final StyleablePropertyFactory<MyButton> FACTORY = new StyleablePropertyFactory<>(Button.getClassCssMetaData());

     MyButton(String labelText) {
         super(labelText);
         getStyleClass().add("my-button");
     }

     // Typical JavaFX property implementation
     public ObservableValue<Boolean> selectedProperty() { return ( ObservableValue<Boolean>)selected; }
     public final boolean isSelected() { return selected.getValue(); }
     public final void setSelected(boolean isSelected) { selected.setValue(isSelected); }

     // StyleableProperty implementation reduced to one line
     private final StyleableProperty<Boolean> selected =
         FACTORY.createStyleableBooleanProperty(this, "selected", "-my-selected", s -> s.selected);

     @Override
     public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() {
         return FACTORY.getCssMetaData();
     }

 }

The example above is the simplest use of StyleablePropertyFactory. But, this use does not provide the static CssMetaData that is useful for getClassCssMetaData(), which is described in the javadoc for CssMetaData). Static CssMetaData can, however, be created via StyleablePropertyFactory methods and will be returned by the methods which create StyleableProperty instances, as the example below illustrates. Note that the static method getClassCssMetaData() is a convention used throughout the JavaFX code base but the getClassCssMetaData() method itself is not used at runtime.

public final class MyButton extends Button {

     private static final StyleablePropertyFactory<MyButton> FACTORY =
         new StyleablePropertyFactory<>(Button.getClassCssMetaData());

     private static final CssMetaData<MyButton, Boolean> SELECTED =
         FACTORY.createBooleanCssMetaData("-my-selected", s -> s.selected, false, false);

     MyButton(String labelText) {
         super(labelText);
         getStyleClass().add("my-button");
     }

     // Typical JavaFX property implementation
     public ObservableValue<Boolean> selectedProperty() { return ( ObservableValue<Boolean>)selected; }
     public final boolean isSelected() { return selected.getValue(); }
     public final void setSelected(boolean isSelected) { selected.setValue(isSelected); }

     // StyleableProperty implementation reduced to one line
     private final StyleableProperty<Boolean> selected =
         new SimpleStyleableBooleanProperty(SELECTED, this, "selected");

     public static  List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
         return FACTORY.getCssMetaData();
     }

      @Override
     public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() {
         return FACTORY.getCssMetaData();
     }

 }

The same can be accomplished with an inner-class. The previous example called new SimpleStyleableBooleanProperty to create the selected property. This example uses the factory to access the CssMetaData that was created along with the anonymous inner-class. For all intents and purposes, the two examples are the same.

public final class MyButton extends Button {

     private static final StyleablePropertyFactory<MyButton> FACTORY =
         new StyleablePropertyFactory<>(Button.getClassCssMetaData()) {
         {
             createBooleanCssMetaData("-my-selected", s -> s.selected, false, false);
         }
     }


     MyButton(String labelText) {
         super(labelText);
         getStyleClass().add("my-button");
     }

     // Typical JavaFX property implementation
     public ObservableValue<Boolean> selectedProperty() { return ( ObservableValue<Boolean>)selected; }
     public final boolean isSelected() { return selected.getValue(); }
     public final void setSelected(boolean isSelected) { selected.setValue(isSelected); }

     // StyleableProperty implementation reduced to one line
     private final StyleableProperty<Boolean> selected =
         new SimpleStyleableBooleanProperty(this, "selected", "my-selected");

     public static  List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
         return FACTORY.getCssMetaData();
     }

      @Override
     public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() {
         return FACTORY.getCssMetaData();
     }

 }

Caveats:

The only option for creating a StyleableProperty with a number value is to create a StyleableProperty<Number>. The return value from the getValue() method of the StyleableProperty is a Number. Therefore, the get method of the JavaFX property needs to call the correct value method for the return type. For example,
public ObservableValue offsetProperty() { return (ObservableValue)offset; }
     public Double getOffset() { return offset.getValue().doubleValue(); }
     public void setOffset(Double value) { offset.setValue(value); }
     private final StyleableProperty offset = FACTORY.createStyleableNumberProperty(this, "offset", "-my-offset", s -> ((MyButton)s).offset);

Since:

JavaFX 8u40

  • Constructor Summary

    Constructors
    Constructor and Description
    StyleablePropertyFactory(List<CssMetaData<? extends Styleable,?>> parentCssMetaData)
    The constructor is passed the CssMetaData of the parent class of <S>, typically by calling the static getClassCssMetaData() method of the parent.
  • Method Summary

    All MethodsInstance MethodsConcrete Methods
    Modifier and Type Method and Description
    CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function)
    Create a CssMetaData<S, Boolean> with initial value and inherit flag both defaulting to false.
    CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
    Create a CssMetaData<S, Boolean> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function, boolean initialValue, boolean inherits)
    Create a CssMetaData<S, Boolean> with initial value, and inherit flag.
    CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function)
    Create a CssMetaData<S, Color> with initial value of Color.BLACK, and inherit flag defaulting to false.
    CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function, Color initialValue)
    Create a CssMetaData<S, Color> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function, Color initialValue, boolean inherits)
    Create a CssMetaData<S, Color> with initial value, and inherit flag.
    CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function)
    Create a CssMetaData<S, Duration> with initial value of Duration.BLACK, and inherit flag defaulting to false.
    CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue)
    Create a CssMetaData<S, Duration> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)
    Create a CssMetaData<S, Duration> with initial value, and inherit flag.
    <E extends Effect>
    CssMetaData<S,E>
    createEffectCssMetaData(String property, Function<S,StyleableProperty<E>> function)
    Create a CssMetaData<S, Effect> with initial value of null, and inherit flag defaulting to false.
    <E extends Effect>
    CssMetaData<S,E>
    createEffectCssMetaData(String property, Function<S,StyleableProperty<E>> function, E initialValue)
    Create a CssMetaData<S, Effect> with initial value, and inherit flag defaulting to false.
    <E extends Effect>
    CssMetaData<S,E>
    createEffectCssMetaData(String property, Function<S,StyleableProperty<E>> function, E initialValue, boolean inherits)
    Create a CssMetaData<S, Effect> with initial value, and inherit flag.
    <E extends Enum<E>>
    CssMetaData<S,E>
    createEnumCssMetaData(Class<? extends Enum> enumClass, String property, Function<S,StyleableProperty<E>> function)
    Create a CssMetaData<S, Enum> with initial value of null, and inherit flag defaulting to false.
    <E extends Enum<E>>
    CssMetaData<S,E>
    createEnumCssMetaData(Class<? extends Enum> enumClass, String property, Function<S,StyleableProperty<E>> function, E initialValue)
    Create a CssMetaData<S, Enum> with initial value, and inherit flag defaulting to false.
    <E extends Enum<E>>
    CssMetaData<S,E>
    createEnumCssMetaData(Class<? extends Enum> enumClass, String property, Function<S,StyleableProperty<E>> function, E initialValue, boolean inherits)
    Create a CssMetaData<S, Enum> with initial value, and inherit flag.
    CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function)
    Create a CssMetaData<S, Font> with initial value of Font.getDefault(), and inherit flag defaulting to true.
    CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function, Font initialValue)
    Create a CssMetaData<S, Font> with initial value, and inherit flag defaulting to true.
    CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function, Font initialValue, boolean inherits)
    Create a CssMetaData<S, Font> with initial value, and inherit flag.
    CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function)
    Create a CssMetaData<S, Insets> with initial value of javafx.geometry.Insets.EMPTY, and inherit flag defaulting to false.
    CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
    Create a CssMetaData<S, Insets> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function, Insets initialValue, boolean inherits)
    Create a CssMetaData<S, Insets> with initial value, and inherit flag.
    CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function)
    Create a CssMetaData<S, Paint> with initial value of Color.BLACK, and inherit flag defaulting to false.
    CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function, Paint initialValue)
    Create a CssMetaData<S, Paint> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function, Paint initialValue, boolean inherits)
    Create a CssMetaData<S, Paint> with initial value, and inherit flag.
    CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function)
    Create a CssMetaData<S, Number> with initial value of 0d, and inherit flag defaulting to false.
    CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function, Number initialValue)
    Create a CssMetaData<S, Number> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function, Number initialValue, boolean inherits)
    Create a CssMetaData<S, Number> with initial value, and inherit flag.
    CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function)
    Create a CssMetaData<S, String> with initial value of null, and inherit flag defaulting to false.
    CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue)
    Create a CssMetaData<S, String> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
    Create a CssMetaData<S, String> with initial value, and inherit flag.
    StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Boolean> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function)
    Create a StyleableProperty<Boolean>.
    StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
    Create a StyleableProperty<Boolean> with initial value.
    StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue, boolean inherits)
    Create a StyleableProperty<Boolean> with initial value and inherit flag.
    StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Color> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function)
    Create a StyleableProperty<Color>.
    StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue)
    Create a StyleableProperty<Color> with initial value.
    StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue, boolean inherits)
    Create a StyleableProperty<Color> with initial value and inherit flag.
    StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Duration> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function)
    Create a StyleableProperty<Duration>.
    StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)
    Create a StyleableProperty<Duration> with initial value.
    StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)
    Create a StyleableProperty<Duration> with initial value and inherit flag.
    StyleableProperty<Effect> createStyleableEffectProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Effect> using previously created CssMetaData for the given cssProperty.
    <E extends Enum<E>>
    StyleableProperty<E>
    createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Class<E> enumClass)
    Create a StyleableProperty<E extends Enum<E>> using previously created CssMetaData for the given cssProperty.
    <E extends Effect>
    StyleableProperty<E>
    createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function)
    Create a StyleableProperty<Effect>.
    <E extends Effect>
    StyleableProperty<E>
    createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function, E initialValue)
    Create a StyleableProperty<Effect> with initial value.
    <E extends Effect>
    StyleableProperty<E>
    createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function, E initialValue, boolean inherits)
    Create a StyleableProperty<Effect> with initial value and inherit flag.
    <E extends Enum<E>>
    StyleableProperty<E>
    createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function, Class<E> enumClass)
    Create a StyleableProperty<E extends Enum<E>>.
    <E extends Enum<E>>
    StyleableProperty<E>
    createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function, Class<E> enumClass, E initialValue)
    Create a StyleableProperty<E extends Enum<E>> with initial value.
    <E extends Enum<E>>
    StyleableProperty<E>
    createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<E>> function, Class<E> enumClass, E initialValue, boolean inherits)
    Create a StyleableProperty<E extends Enum<E>> with initial value and inherit flag.
    StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Font> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function)
    Create a StyleableProperty<Font>.
    StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue)
    Create a StyleableProperty<Font> with initial value.
    StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue, boolean inherits)
    Create a StyleableProperty<Font> with initial value and inherit flag.
    StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Insets> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function)
    Create a StyleableProperty<Inset>.
    StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
    Create a StyleableProperty<Inset> with initial value.
    StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue, boolean inherits)
    Create a StyleableProperty<Inset> with initial value and inherit flag.
    StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Number> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function)
    Create a StyleableProperty<Number>.
    StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue)
    Create a StyleableProperty<Number> with initial value.
    StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue, boolean inherits)
    Create a StyleableProperty<Number> with initial value and inherit flag.
    StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<Paint> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function)
    Create a StyleableProperty<Paint>.
    StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue)
    Create a StyleableProperty<Paint> with initial value.
    StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue, boolean inherits)
    Create a StyleableProperty<Paint> with initial value and inherit flag.
    StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<String> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
    Create a StyleableProperty<String>.
    StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
    Create a StyleableProperty<String> with initial value.
    StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
    Create a StyleableProperty<String> with initial value and inherit flag.
    StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty)
    Create a StyleableProperty<String> using previously created CssMetaData for the given cssProperty.
    StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
    Create a StyleableProperty<String> with initial value.
    StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
    Create a StyleableProperty<String> with initial value.
    StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
    Create a StyleableProperty<String> with initial value and inherit flag.
    CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function)
    Create a CssMetaData<S, String> with initial value of null, and inherit flag defaulting to false.
    CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue)
    Create a CssMetaData<S, String> with initial value, and inherit flag defaulting to false.
    CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
    Create a CssMetaData<S, String> with initial value, and inherit flag.
    List<CssMetaData<? extends Styleable,?>> getCssMetaData()
    Get the CssMetaData for the given Styleable.
    • Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Detail

    • StyleablePropertyFactory

      public StyleablePropertyFactory(List<CssMetaData<? extends Styleable,?>> parentCssMetaData)
      The constructor is passed the CssMetaData of the parent class of <S>, typically by calling the static getClassCssMetaData() method of the parent.

      Parameters:

      parentCssMetaData - The CssMetaData of the parent class of <S>, or null.

  • Method Detail

    • getCssMetaData

      public final List<CssMetaData<? extends Styleable,?>> getCssMetaData()
      Get the CssMetaData for the given Styleable. For a Node other than a Control, this method should be called from the Styleable.getCssMetaData() method. For a Control, this method should be called from the Control.getControlCssMetaData() method.
    • createStyleableBooleanProperty

      public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable,
                                                                             String propertyName,
                                                                             String cssProperty,
                                                                             Function<S,StyleableProperty<Boolean>> function,
                                                                             boolean initialValue,
                                                                             boolean inherits)
      Create a StyleableProperty<Boolean> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableBooleanProperty

      public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable,
                                                                             String propertyName,
                                                                             String cssProperty,
                                                                             Function<S,StyleableProperty<Boolean>> function,
                                                                             boolean initialValue)
      Create a StyleableProperty<Boolean> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableBooleanProperty

      public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable,
                                                                             String propertyName,
                                                                             String cssProperty,
                                                                             Function<S,StyleableProperty<Boolean>> function)
      Create a StyleableProperty<Boolean>. The initialValue and inherit flag default to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableBooleanProperty

      public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable,
                                                                             String propertyName,
                                                                             String cssProperty)
      Create a StyleableProperty<Boolean> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableColorProperty

      public final StyleableProperty<Color> createStyleableColorProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Color>> function,
                                                                         Color initialValue,
                                                                         boolean inherits)
      Create a StyleableProperty<Color> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableColorProperty

      public final StyleableProperty<Color> createStyleableColorProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Color>> function,
                                                                         Color initialValue)
      Create a StyleableProperty<Color> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableColorProperty

      public final StyleableProperty<Color> createStyleableColorProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Color>> function)
      Create a StyleableProperty<Color>. The initial value defaults to Color.BLACK and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableColorProperty

      public final StyleableProperty<Color> createStyleableColorProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty)
      Create a StyleableProperty<Color> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableDurationProperty

      public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable,
                                                                               String propertyName,
                                                                               String cssProperty,
                                                                               Function<S,StyleableProperty<Duration>> function,
                                                                               Duration initialValue,
                                                                               boolean inherits)
      Create a StyleableProperty<Duration> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableDurationProperty

      public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable,
                                                                               String propertyName,
                                                                               String cssProperty,
                                                                               Function<S,StyleableProperty<Duration>> function,
                                                                               Duration initialValue)
      Create a StyleableProperty<Duration> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableDurationProperty

      public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable,
                                                                               String propertyName,
                                                                               String cssProperty,
                                                                               Function<S,StyleableProperty<Duration>> function)
      Create a StyleableProperty<Duration>. The initial value defaults to Duration.BLACK and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableDurationProperty

      public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable,
                                                                               String propertyName,
                                                                               String cssProperty)
      Create a StyleableProperty<Duration> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableEffectProperty

      public final <E extends Effect> StyleableProperty<E> createStyleableEffectProperty(S styleable,
                                                                                         String propertyName,
                                                                                         String cssProperty,
                                                                                         Function<S,StyleableProperty<E>> function,
                                                                                         E initialValue,
                                                                                         boolean inherits)
      Create a StyleableProperty<Effect> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEffectProperty

      public final <E extends Effect> StyleableProperty<E> createStyleableEffectProperty(S styleable,
                                                                                         String propertyName,
                                                                                         String cssProperty,
                                                                                         Function<S,StyleableProperty<E>> function,
                                                                                         E initialValue)
      Create a StyleableProperty<Effect> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEffectProperty

      public final <E extends Effect> StyleableProperty<E> createStyleableEffectProperty(S styleable,
                                                                                         String propertyName,
                                                                                         String cssProperty,
                                                                                         Function<S,StyleableProperty<E>> function)
      Create a StyleableProperty<Effect>. The initial value is null and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEffectProperty

      public final StyleableProperty<Effect> createStyleableEffectProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty)
      Create a StyleableProperty<Effect> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableEnumProperty

      public final <E extends Enum<E>> StyleableProperty<E> createStyleableEnumProperty(S styleable,
                                                                                        String propertyName,
                                                                                        String cssProperty,
                                                                                        Function<S,StyleableProperty<E>> function,
                                                                                        Class<E> enumClass,
                                                                                        E initialValue,
                                                                                        boolean inherits)
      Create a StyleableProperty<E extends Enum<E>> with initial value and inherit flag. The enumClass parameter is the Class of the Enum that is the value of the property. For example,
      private static final StyleablePropertyFactory<MyControl> FACTORY = new StyleablePropertyFactory<>();
           StyleableProperty<Orientation> orientation =
               FACTORY.createStyleableEnumProperty(
                   this, 
                   "orientation", 
                   "-my-orientation", 
                   s -> ((MyControl)s).orientation,
                   Orientation.class,
                   Orientation.HORIZONTAL,
                   false);

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEnumProperty

      public final <E extends Enum<E>> StyleableProperty<E> createStyleableEnumProperty(S styleable,
                                                                                        String propertyName,
                                                                                        String cssProperty,
                                                                                        Function<S,StyleableProperty<E>> function,
                                                                                        Class<E> enumClass,
                                                                                        E initialValue)
      Create a StyleableProperty<E extends Enum<E>> with initial value. The inherit flag defaults to false. The enumClass parameter is the Class of the Enum that is the value of the property. For example,
      private static final StyleablePropertyFactory<MyControl> FACTORY = new StyleablePropertyFactory<>();
           StyleableProperty<Orientation> orientation =
               FACTORY.createStyleableEnumProperty(
                   this, 
                   "orientation", 
                   "-my-orientation", 
                   s -> ((MyControl)s).orientation,
                   Orientation.class,
                   Orientation.HORIZONTAL);

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEnumProperty

      public final <E extends Enum<E>> StyleableProperty<E> createStyleableEnumProperty(S styleable,
                                                                                        String propertyName,
                                                                                        String cssProperty,
                                                                                        Function<S,StyleableProperty<E>> function,
                                                                                        Class<E> enumClass)
      Create a StyleableProperty<E extends Enum<E>>. The initial value is null and inherit flag defaults to false. The enumClass parameter is the Class of the Enum that is the value of the property. For example,
      private static final StyleablePropertyFactory<MyControl> FACTORY = new StyleablePropertyFactory<>();
           StyleableProperty<Orientation> orientation =
               FACTORY.createStyleableEnumProperty(
                   this, 
                   "orientation", 
                   "-my-orientation", 
                   s -> ((MyControl)s).orientation,
                   Orientation.class);

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableEffectProperty

      public final <E extends Enum<E>> StyleableProperty<E> createStyleableEffectProperty(S styleable,
                                                                                          String propertyName,
                                                                                          String cssProperty,
                                                                                          Class<E> enumClass)
      Create a StyleableProperty<E extends Enum<E>> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableFontProperty

      public final StyleableProperty<Font> createStyleableFontProperty(S styleable,
                                                                       String propertyName,
                                                                       String cssProperty,
                                                                       Function<S,StyleableProperty<Font>> function,
                                                                       Font initialValue,
                                                                       boolean inherits)
      Create a StyleableProperty<Font> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableFontProperty

      public final StyleableProperty<Font> createStyleableFontProperty(S styleable,
                                                                       String propertyName,
                                                                       String cssProperty,
                                                                       Function<S,StyleableProperty<Font>> function,
                                                                       Font initialValue)
      Create a StyleableProperty<Font> with initial value. The inherit flag defaults to true.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableFontProperty

      public final StyleableProperty<Font> createStyleableFontProperty(S styleable,
                                                                       String propertyName,
                                                                       String cssProperty,
                                                                       Function<S,StyleableProperty<Font>> function)
      Create a StyleableProperty<Font>. The initial value defaults to Font.getDefault() and the inherit flag defaults to true.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableFontProperty

      public final StyleableProperty<Font> createStyleableFontProperty(S styleable,
                                                                       String propertyName,
                                                                       String cssProperty)
      Create a StyleableProperty<Font> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableInsetsProperty

      public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Insets>> function,
                                                                           Insets initialValue,
                                                                           boolean inherits)
      Create a StyleableProperty<Inset> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableInsetsProperty

      public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Insets>> function,
                                                                           Insets initialValue)
      Create a StyleableProperty<Inset> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableInsetsProperty

      public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Insets>> function)
      Create a StyleableProperty<Inset>. The initial value is Insets.EMPTY and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableInsetsProperty

      public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty)
      Create a StyleableProperty<Insets> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleablePaintProperty

      public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Paint>> function,
                                                                         Paint initialValue,
                                                                         boolean inherits)
      Create a StyleableProperty<Paint> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleablePaintProperty

      public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Paint>> function,
                                                                         Paint initialValue)
      Create a StyleableProperty<Paint> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleablePaintProperty

      public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty,
                                                                         Function<S,StyleableProperty<Paint>> function)
      Create a StyleableProperty<Paint>. The initial value defautls to Color.BLACK and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleablePaintProperty

      public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable,
                                                                         String propertyName,
                                                                         String cssProperty)
      Create a StyleableProperty<Paint> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableNumberProperty

      public final StyleableProperty<Number> createStyleableNumberProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Number>> function,
                                                                           Number initialValue,
                                                                           boolean inherits)
      Create a StyleableProperty<Number> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableNumberProperty

      public final StyleableProperty<Number> createStyleableNumberProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Number>> function,
                                                                           Number initialValue)
      Create a StyleableProperty<Number> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableNumberProperty

      public final StyleableProperty<Number> createStyleableNumberProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<Number>> function)
      Create a StyleableProperty<Number>. The initial value defaults to zero. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableNumberProperty

      public final StyleableProperty<Number> createStyleableNumberProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty)
      Create a StyleableProperty<Number> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableStringProperty

      public final StyleableProperty<String> createStyleableStringProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<String>> function,
                                                                           String initialValue,
                                                                           boolean inherits)
      Create a StyleableProperty<String> with initial value and inherit flag.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableStringProperty

      public final StyleableProperty<String> createStyleableStringProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<String>> function,
                                                                           String initialValue)
      Create a StyleableProperty<String> with initial value. The inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableStringProperty

      public final StyleableProperty<String> createStyleableStringProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty,
                                                                           Function<S,StyleableProperty<String>> function)
      Create a StyleableProperty<String>. The initial value defaults to null and the inherit flag defaults to false.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableStringProperty

      public final StyleableProperty<String> createStyleableStringProperty(S styleable,
                                                                           String propertyName,
                                                                           String cssProperty)
      Create a StyleableProperty<String> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createStyleableUrlProperty

      public final StyleableProperty<String> createStyleableUrlProperty(S styleable,
                                                                        String propertyName,
                                                                        String cssProperty,
                                                                        Function<S,StyleableProperty<String>> function,
                                                                        String initialValue,
                                                                        boolean inherits)
      Create a StyleableProperty<String> with initial value and inherit flag. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableUrlProperty

      public final StyleableProperty<String> createStyleableUrlProperty(S styleable,
                                                                        String propertyName,
                                                                        String cssProperty,
                                                                        Function<S,StyleableProperty<String>> function,
                                                                        String initialValue)
      Create a StyleableProperty<String> with initial value. The inherit flag defaults to false. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableUrlProperty

      public final StyleableProperty<String> createStyleableUrlProperty(S styleable,
                                                                        String propertyName,
                                                                        String cssProperty,
                                                                        Function<S,StyleableProperty<String>> function)
      Create a StyleableProperty<String> with initial value. The inherit flag defaults to false. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

    • createStyleableUrlProperty

      public final StyleableProperty<String> createStyleableUrlProperty(S styleable,
                                                                        String propertyName,
                                                                        String cssProperty)
      Create a StyleableProperty<String> using previously created CssMetaData for the given cssProperty.

      Parameters:

      styleable - The this reference of the returned property. This is also the property bean.

      Throws:

      IllegalArgumentException - if cssProperty is null or empty

    • createBooleanCssMetaData

      public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property,
                                                                   Function<S,StyleableProperty<Boolean>> function,
                                                                   boolean initialValue,
                                                                   boolean inherits)
      Create a CssMetaData<S, Boolean> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createBooleanCssMetaData

      public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property,
                                                                   Function<S,StyleableProperty<Boolean>> function,
                                                                   boolean initialValue)
      Create a CssMetaData<S, Boolean> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createBooleanCssMetaData

      public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property,
                                                                   Function<S,StyleableProperty<Boolean>> function)
      Create a CssMetaData<S, Boolean> with initial value and inherit flag both defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createColorCssMetaData

      public final CssMetaData<S,Color> createColorCssMetaData(String property,
                                                               Function<S,StyleableProperty<Color>> function,
                                                               Color initialValue,
                                                               boolean inherits)
      Create a CssMetaData<S, Color> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createColorCssMetaData

      public final CssMetaData<S,Color> createColorCssMetaData(String property,
                                                               Function<S,StyleableProperty<Color>> function,
                                                               Color initialValue)
      Create a CssMetaData<S, Color> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createColorCssMetaData

      public final CssMetaData<S,Color> createColorCssMetaData(String property,
                                                               Function<S,StyleableProperty<Color>> function)
      Create a CssMetaData<S, Color> with initial value of Color.BLACK, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createDurationCssMetaData

      public final CssMetaData<S,Duration> createDurationCssMetaData(String property,
                                                                     Function<S,StyleableProperty<Duration>> function,
                                                                     Duration initialValue,
                                                                     boolean inherits)
      Create a CssMetaData<S, Duration> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createDurationCssMetaData

      public final CssMetaData<S,Duration> createDurationCssMetaData(String property,
                                                                     Function<S,StyleableProperty<Duration>> function,
                                                                     Duration initialValue)
      Create a CssMetaData<S, Duration> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createDurationCssMetaData

      public final CssMetaData<S,Duration> createDurationCssMetaData(String property,
                                                                     Function<S,StyleableProperty<Duration>> function)
      Create a CssMetaData<S, Duration> with initial value of Duration.BLACK, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEffectCssMetaData

      public final <E extends Effect> CssMetaData<S,E> createEffectCssMetaData(String property,
                                                                               Function<S,StyleableProperty<E>> function,
                                                                               E initialValue,
                                                                               boolean inherits)
      Create a CssMetaData<S, Effect> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEffectCssMetaData

      public final <E extends Effect> CssMetaData<S,E> createEffectCssMetaData(String property,
                                                                               Function<S,StyleableProperty<E>> function,
                                                                               E initialValue)
      Create a CssMetaData<S, Effect> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEffectCssMetaData

      public final <E extends Effect> CssMetaData<S,E> createEffectCssMetaData(String property,
                                                                               Function<S,StyleableProperty<E>> function)
      Create a CssMetaData<S, Effect> with initial value of null, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEnumCssMetaData

      public final <E extends Enum<E>> CssMetaData<S,E> createEnumCssMetaData(Class<? extends Enum> enumClass,
                                                                              String property,
                                                                              Function<S,StyleableProperty<E>> function,
                                                                              E initialValue,
                                                                              boolean inherits)
      Create a CssMetaData<S, Enum> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEnumCssMetaData

      public final <E extends Enum<E>> CssMetaData<S,E> createEnumCssMetaData(Class<? extends Enum> enumClass,
                                                                              String property,
                                                                              Function<S,StyleableProperty<E>> function,
                                                                              E initialValue)
      Create a CssMetaData<S, Enum> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createEnumCssMetaData

      public final <E extends Enum<E>> CssMetaData<S,E> createEnumCssMetaData(Class<? extends Enum> enumClass,
                                                                              String property,
                                                                              Function<S,StyleableProperty<E>> function)
      Create a CssMetaData<S, Enum> with initial value of null, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createFontCssMetaData

      public final CssMetaData<S,Font> createFontCssMetaData(String property,
                                                             Function<S,StyleableProperty<Font>> function,
                                                             Font initialValue,
                                                             boolean inherits)
      Create a CssMetaData<S, Font> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createFontCssMetaData

      public final CssMetaData<S,Font> createFontCssMetaData(String property,
                                                             Function<S,StyleableProperty<Font>> function,
                                                             Font initialValue)
      Create a CssMetaData<S, Font> with initial value, and inherit flag defaulting to true.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createFontCssMetaData

      public final CssMetaData<S,Font> createFontCssMetaData(String property,
                                                             Function<S,StyleableProperty<Font>> function)
      Create a CssMetaData<S, Font> with initial value of Font.getDefault(), and inherit flag defaulting to true.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createInsetsCssMetaData

      public final CssMetaData<S,Insets> createInsetsCssMetaData(String property,
                                                                 Function<S,StyleableProperty<Insets>> function,
                                                                 Insets initialValue,
                                                                 boolean inherits)
      Create a CssMetaData<S, Insets> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createInsetsCssMetaData

      public final CssMetaData<S,Insets> createInsetsCssMetaData(String property,
                                                                 Function<S,StyleableProperty<Insets>> function,
                                                                 Insets initialValue)
      Create a CssMetaData<S, Insets> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createInsetsCssMetaData

      public final CssMetaData<S,Insets> createInsetsCssMetaData(String property,
                                                                 Function<S,StyleableProperty<Insets>> function)
      Create a CssMetaData<S, Insets> with initial value of javafx.geometry.Insets.EMPTY, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createPaintCssMetaData

      public final CssMetaData<S,Paint> createPaintCssMetaData(String property,
                                                               Function<S,StyleableProperty<Paint>> function,
                                                               Paint initialValue,
                                                               boolean inherits)
      Create a CssMetaData<S, Paint> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createPaintCssMetaData

      public final CssMetaData<S,Paint> createPaintCssMetaData(String property,
                                                               Function<S,StyleableProperty<Paint>> function,
                                                               Paint initialValue)
      Create a CssMetaData<S, Paint> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createPaintCssMetaData

      public final CssMetaData<S,Paint> createPaintCssMetaData(String property,
                                                               Function<S,StyleableProperty<Paint>> function)
      Create a CssMetaData<S, Paint> with initial value of Color.BLACK, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createSizeCssMetaData

      public final CssMetaData<S,Number> createSizeCssMetaData(String property,
                                                               Function<S,StyleableProperty<Number>> function,
                                                               Number initialValue,
                                                               boolean inherits)
      Create a CssMetaData<S, Number> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createSizeCssMetaData

      public final CssMetaData<S,Number> createSizeCssMetaData(String property,
                                                               Function<S,StyleableProperty<Number>> function,
                                                               Number initialValue)
      Create a CssMetaData<S, Number> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createSizeCssMetaData

      public final CssMetaData<S,Number> createSizeCssMetaData(String property,
                                                               Function<S,StyleableProperty<Number>> function)
      Create a CssMetaData<S, Number> with initial value of 0d, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createStringCssMetaData

      public final CssMetaData<S,String> createStringCssMetaData(String property,
                                                                 Function<S,StyleableProperty<String>> function,
                                                                 String initialValue,
                                                                 boolean inherits)
      Create a CssMetaData<S, String> with initial value, and inherit flag.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createStringCssMetaData

      public final CssMetaData<S,String> createStringCssMetaData(String property,
                                                                 Function<S,StyleableProperty<String>> function,
                                                                 String initialValue)
      Create a CssMetaData<S, String> with initial value, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createStringCssMetaData

      public final CssMetaData<S,String> createStringCssMetaData(String property,
                                                                 Function<S,StyleableProperty<String>> function)
      Create a CssMetaData<S, String> with initial value of null, and inherit flag defaulting to false.

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createUrlCssMetaData

      public final CssMetaData<S,String> createUrlCssMetaData(String property,
                                                              Function<S,StyleableProperty<String>> function,
                                                              String initialValue,
                                                              boolean inherits)
      Create a CssMetaData<S, String> with initial value, and inherit flag. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createUrlCssMetaData

      public final CssMetaData<S,String> createUrlCssMetaData(String property,
                                                              Function<S,StyleableProperty<String>> function,
                                                              String initialValue)
      Create a CssMetaData<S, String> with initial value, and inherit flag defaulting to false. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

    • createUrlCssMetaData

      public final CssMetaData<S,String> createUrlCssMetaData(String property,
                                                              Function<S,StyleableProperty<String>> function)
      Create a CssMetaData<S, String> with initial value of null, and inherit flag defaulting to false. Here, the String value represents a URL converted from a CSS url("").

      Parameters:

      property - The CSS property name.

      Throws:

      IllegalArgumentException - if property is null or an empty string, or function is null.

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API