- java.lang.Object
-
- javafx.css.StyleablePropertyFactory
- javafx.css.StyleablePropertyFactory
-
- Type Parameters:
S
- The type of Styleable
public class StyleablePropertyFactory
Styleable>extends ObjectMethods 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 theStyleablePropertyFactory
as a static member, as shown below, is recommended.public final class MyButton extends Button { private static final StyleablePropertyFactory
FACTORY = new StyleablePropertyFactory<>(Button.getClassCssMetaData()); MyButton(String labelText) { super(labelText); getStyleClass().add("my-button"); } // Typical JavaFX property implementation public ObservableValue selectedProperty() { return (ObservableValue )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 selected = FACTORY.createStyleableBooleanProperty(this, "selected", "-my-selected", s -> s.selected); @Override public List > 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 forgetClassCssMetaData()
, which is described in the javadoc forCssMetaData
. Static CssMetaData can, however, be created viaStyleablePropertyFactory
methods and will be returned by the methods which create StyleableProperty instances, as the example below illustrates. Note that the static methodgetClassCssMetaData()
is a convention used throughout the JavaFX code base but thegetClassCssMetaData()
method itself is not used at runtime.public final class MyButton extends Button { private static final StyleablePropertyFactory
FACTORY = new StyleablePropertyFactory<>(Button.getClassCssMetaData()); private static final CssMetaData 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 selectedProperty() { return (ObservableValue )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 selected = new SimpleStyleableBooleanProperty(SELECTED, this, "selected"); public static List > getClassCssMetaData() { return FACTORY.getCssMetaData(); } @Override public List > getControlCssMetaData() { return FACTORY.getCssMetaData(); } } The same can be accomplished with an inner-class. The previous example called
new SimpleStyleableBooleanProperty
to create theselected
property. This example uses the factory to access theCssMetaData
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
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 selectedProperty() { return (ObservableValue )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 selected = new SimpleStyleableBooleanProperty(this, "selected", "my-selected"); public static List > getClassCssMetaData() { return FACTORY.getCssMetaData(); } @Override public List > getControlCssMetaData() { return FACTORY.getCssMetaData(); } } Caveats:
The only option for creating a StyleableProperty with a number value is to create a StyleableProperty. The return value from the getValue()
method of the StyleableProperty is a Number. Therefore, theget
method of the JavaFX property needs to call the correctvalue
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 Description StyleablePropertyFactory(List<CssMetaData extends Styleable,?>> parentCssMetaData)
The constructor is passed the CssMetaData of the parent class of, typically by calling the staticgetClassCssMetaData()
method of the parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CssMetaData<S,Boolean>
createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function)
Create a CssMetaDatawith initial value and inherit flag both defaulting to false.CssMetaData<S,Boolean>
createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
Create a CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Color>
createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function)
Create a CssMetaDatawith 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 CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Duration>
createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function)
Create a CssMetaDatawith 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 CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.Effect>
CssMetaData<S,E>createEffectCssMetaData(String property, Function<S,StyleableProperty
> function) Create a CssMetaDatawith initial value of null, and inherit flag defaulting to false.Effect>
CssMetaData<S,E>createEffectCssMetaData(String property, Function<S,StyleableProperty
> function, E initialValue) Create a CssMetaDatawith initial value, and inherit flag defaulting to false.Effect>
CssMetaData<S,E>createEffectCssMetaData(String property, Function<S,StyleableProperty
> function, E initialValue, boolean inherits) Create a CssMetaDatawith initial value, and inherit flag.Enum >
CssMetaData<S,E>createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty
> function) Create a CssMetaDatawith initial value of null, and inherit flag defaulting to false.Enum >
CssMetaData<S,E>createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty
> function, E initialValue) Create a CssMetaDatawith initial value, and inherit flag defaulting to false.Enum >
CssMetaData<S,E>createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty
> function, E initialValue, boolean inherits) Create a CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Font>
createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function)
Create a CssMetaDatawith initial value ofFont.getDefault()
, and inherit flag defaulting to true.CssMetaData<S,Font>
createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function, Font initialValue)
Create a CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Insets>
createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function)
Create a CssMetaDatawith initial value ofInsets.EMPTY
, and inherit flag defaulting to false.CssMetaData<S,Insets>
createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
Create a CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Paint>
createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function)
Create a CssMetaDatawith 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 CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,Number>
createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function)
Create a CssMetaDatawith initial value of0d
, and inherit flag defaulting to false.CssMetaData<S,Number>
createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function, Number initialValue)
Create a CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.CssMetaData<S,String>
createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function)
Create a CssMetaDatawith 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 CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.StyleableProperty<Boolean>
createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Boolean>
createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function)
Create a StyleableProperty. StyleableProperty<Boolean>
createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Boolean>
createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<Color>
createStyleableColorProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Color>
createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function)
Create a StyleableProperty. StyleableProperty<Color>
createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Color>
createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<Duration>
createStyleableDurationProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Duration>
createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function)
Create a StyleableProperty. StyleableProperty<Duration>
createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Duration>
createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<Effect>
createStyleableEffectProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.Enum >
StyleablePropertycreateStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Class
enumClass) Create a StyleableProperty> using previously created CssMetaData for the given cssProperty
.Effect>
StyleablePropertycreateStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function) Create a StyleableProperty. Effect>
StyleablePropertycreateStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function, E initialValue) Create a StyleablePropertywith initial value. Effect>
StyleablePropertycreateStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function, E initialValue, boolean inherits) Create a StyleablePropertywith initial value and inherit flag. Enum >
StyleablePropertycreateStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function, Class enumClass) Create a StyleableProperty>. Enum >
StyleablePropertycreateStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function, Class enumClass, E initialValue) Create a StyleableProperty> with initial value. Enum >
StyleablePropertycreateStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty
> function, Class enumClass, E initialValue, boolean inherits) Create a StyleableProperty> with initial value and inherit flag. StyleableProperty<Font>
createStyleableFontProperty(S styleable, String propertyName, String cssProperty)
Create a StyleableProperty using previously created CssMetaData for the givencssProperty
.StyleableProperty<Font>
createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function)
Create a StyleableProperty.StyleableProperty<Font>
createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue)
Create a StyleableProperty with initial value.StyleableProperty<Font>
createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue, boolean inherits)
Create a StyleableProperty with initial value and inherit flag.StyleableProperty<Insets>
createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Insets>
createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function)
Create a StyleableProperty. StyleableProperty<Insets>
createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Insets>
createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<Number>
createStyleableNumberProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Number>
createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function)
Create a StyleableProperty. StyleableProperty<Number>
createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Number>
createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<Paint>
createStyleablePaintProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<Paint>
createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function)
Create a StyleableProperty. StyleableProperty<Paint>
createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<Paint>
createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<String>
createStyleableStringProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<String>
createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
Create a StyleableProperty. StyleableProperty<String>
createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<String>
createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. StyleableProperty<String>
createStyleableUrlProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.StyleableProperty<String>
createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
Create a StyleablePropertywith initial value. StyleableProperty<String>
createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
Create a StyleablePropertywith initial value. StyleableProperty<String>
createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. CssMetaData<S,String>
createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function)
Create a CssMetaDatawith 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 CssMetaDatawith 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 CssMetaDatawith initial value, and inherit flag.List<CssMetaData extends Styleable,?>>
getCssMetaData()
Get the CssMetaData for the given Styleable.
-
-
-
Constructor Detail
-
StyleablePropertyFactory
public StyleablePropertyFactory(List<CssMetaData extends Styleable,?>> parentCssMetaData)
The constructor is passed the CssMetaData of the parent class of, typically by calling the staticgetClassCssMetaData()
method of the parent.- Parameters:
parentCssMetaData
- The CssMetaData of the parent class of, 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 theStyleable.getCssMetaData()
method. For a Control, this method should be called from theControl.getControlCssMetaData()
method.- Returns:
- the CssMetaData for the given Styleable
-
createStyleableBooleanProperty
public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableBooleanProperty
public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value
-
createStyleableBooleanProperty
public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Boolean>> function)
Create a StyleableProperty. The initialValue and inherit flag default to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with default initialValue and inherit flag
-
createStyleableBooleanProperty
public final StyleableProperty<Boolean> createStyleableBooleanProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableColorProperty
public final StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableColorProperty
public final StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function, Color initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value
-
createStyleableColorProperty
public final StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Color>> function)
Create a StyleableProperty. The initial value defaults to Color.BLACK and the inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with default initial value and inherit flag
-
createStyleableColorProperty
public final StyleableProperty<Color> createStyleableColorProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableDurationProperty
public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableDurationProperty
public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableDurationProperty
public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function)
Create a StyleableProperty. The initial value defaults to Duration.BLACK and the inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with default initial value and false inherit flag
-
createStyleableDurationProperty
public final StyleableProperty<Duration> createStyleableDurationProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableEffectProperty
public final
Effect> StyleableProperty createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function, E initialValue, boolean inherits) Create a StyleablePropertywith initial value and inherit flag. - Type Parameters:
E
- The type of StyleableProperty- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableEffectProperty
public final
Effect> StyleableProperty createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function, E initialValue) Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Type Parameters:
E
- The StyleableProperty created with initial value and false inherit flag- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableEffectProperty
public final
Effect> StyleableProperty createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function) Create a StyleableProperty. The initial value is null and the inherit flag defaults to false. - Type Parameters:
E
- The StyleableProperty created with null initial value and false inherit flag- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with null initial value and false inherit flag
-
createStyleableEffectProperty
public final StyleableProperty<Effect> createStyleableEffectProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- StyleableProperty created using previously created CssMetaData for the given
cssProperty
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableEnumProperty
public final
Enum > StyleableProperty createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function, Class enumClass, E initialValue, boolean inherits) Create a StyleableProperty> 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
FACTORY = new StyleablePropertyFactory<>(); StyleableProperty orientation = FACTORY.createStyleableEnumProperty( this, "orientation", "-my-orientation", s -> ((MyControl)s).orientation, Orientation.class, Orientation.HORIZONTAL, false); - Type Parameters:
E
- The StyleableProperty created with initial value and inherit flag- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleableProperty> cssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty> that was created by this method call. enumClass
- The Enum class that is the type of the StyleableProperty>. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableEnumProperty
public final
Enum > StyleableProperty createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function, Class enumClass, E initialValue) Create a StyleableProperty> 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
FACTORY = new StyleablePropertyFactory<>(); StyleableProperty orientation = FACTORY.createStyleableEnumProperty( this, "orientation", "-my-orientation", s -> ((MyControl)s).orientation, Orientation.class, Orientation.HORIZONTAL); - Type Parameters:
E
- The StyleableProperty created with initial value and false inherit flag- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleableProperty> cssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty> that was created by this method call. enumClass
- The Enum class that is the type of the StyleableProperty>. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableEnumProperty
public final
Enum > StyleableProperty createStyleableEnumProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty > function, Class enumClass) Create a StyleableProperty>. 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
FACTORY = new StyleablePropertyFactory<>(); StyleableProperty orientation = FACTORY.createStyleableEnumProperty( this, "orientation", "-my-orientation", s -> ((MyControl)s).orientation, Orientation.class); - Type Parameters:
E
- The StyleableProperty created with null initial value and false inherit flag- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleableProperty> cssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty> that was created by this method call. enumClass
- The Enum class that is the type of the StyleableProperty>. - Returns:
- a StyleableProperty created with null initial value and false inherit flag
-
createStyleableEffectProperty
public final
Enum > StyleableProperty createStyleableEffectProperty(S styleable, String propertyName, String cssProperty, Class enumClass) Create a StyleableProperty> using previously created CssMetaData for the given cssProperty
.- Type Parameters:
E
- The StyleableProperty created using previously created CssMetaData- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleableProperty> cssProperty
- The CSS property nameenumClass
- The Enum class that is the type of the StyleableProperty>. - Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableFontProperty
public final StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue, boolean inherits)
Create a StyleableProperty with initial value and inherit flag.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty that was created by this method call.initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableFontProperty
public final StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function, Font initialValue)
Create a StyleableProperty with initial value. The inherit flag defaults to true.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty that was created by this method call.initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and true inherit flag
-
createStyleableFontProperty
public final StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Font>> function)
Create a StyleableProperty. The initial value defaults toFont.getDefault()
and the inherit flag defaults to true.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleableProperty that was created by this method call.- Returns:
- a StyleableProperty created with default font initial value and true inherit flag
-
createStyleableFontProperty
public final StyleableProperty<Font> createStyleableFontProperty(S styleable, String propertyName, String cssProperty)
Create a StyleableProperty using previously created CssMetaData for the givencssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableInsetsProperty
public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableInsetsProperty
public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableInsetsProperty
public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Insets>> function)
Create a StyleableProperty. The initial value is Insets.EMPTY
and the inherit flag defaults to false.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableInsetsProperty
public final StyleableProperty<Insets> createStyleableInsetsProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleablePaintProperty
public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleablePaintProperty
public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function, Paint initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleablePaintProperty
public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Paint>> function)
Create a StyleableProperty. The initial value defautls to Color.BLACK and the inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleablePaintProperty
public final StyleableProperty<Paint> createStyleablePaintProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableNumberProperty
public final StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableNumberProperty
public final StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function, Number initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableNumberProperty
public final StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Number>> function)
Create a StyleableProperty. The initial value defaults to zero. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with zero initial value and false inherit flag
-
createStyleableNumberProperty
public final StyleableProperty<Number> createStyleableNumberProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableStringProperty
public final StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableStringProperty
public final StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableStringProperty
public final StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
Create a StyleableProperty. The initial value defaults to null and the inherit flag defaults to false. - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with null initial value and false inherit flag
-
createStyleableStringProperty
public final StyleableProperty<String> createStyleableStringProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createStyleableUrlProperty
public final StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a StyleablePropertywith initial value and inherit flag. Here, the String value represents a URL converted from a CSS url(" "). - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a StyleableProperty created with initial value and inherit flag
-
createStyleableUrlProperty
public final StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function, String initialValue)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. Here, the String value represents a URL converted from a CSS url(" "). - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableUrlProperty
public final StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<String>> function)
Create a StyleablePropertywith initial value. The inherit flag defaults to false. Here, the String value represents a URL converted from a CSS url(" "). - Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property namefunction
- A function that returns the StyleablePropertythat was created by this method call. - Returns:
- a StyleableProperty created with initial value and false inherit flag
-
createStyleableUrlProperty
public final StyleableProperty<String> createStyleableUrlProperty(S styleable, String propertyName, String cssProperty)
Create a StyleablePropertyusing previously created CssMetaData for the given cssProperty
.- Parameters:
styleable
- Thethis
reference of the returned property. This is also the property bean.propertyName
- The field name of the StyleablePropertycssProperty
- The CSS property name- Returns:
- a StyleableProperty created using previously created CssMetaData
- Throws:
IllegalArgumentException
- ifcssProperty
is null or emptyNoSuchElementException
- if the CssMetaData forcssProperty
was not created prior to this method invocation
-
createBooleanCssMetaData
public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function, boolean initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createBooleanCssMetaData
public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function, boolean initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createBooleanCssMetaData
public final CssMetaData<S,Boolean> createBooleanCssMetaData(String property, Function<S,StyleableProperty<Boolean>> function)
Create a CssMetaDatawith initial value and inherit flag both defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with false initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createColorCssMetaData
public final CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function, Color initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createColorCssMetaData
public final CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function, Color initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createColorCssMetaData
public final CssMetaData<S,Color> createColorCssMetaData(String property, Function<S,StyleableProperty<Color>> function)
Create a CssMetaDatawith initial value of Color.BLACK, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createDurationCssMetaData
public final CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createDurationCssMetaData
public final CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createDurationCssMetaData
public final CssMetaData<S,Duration> createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function)
Create a CssMetaDatawith initial value of Duration.BLACK, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEffectCssMetaData
public final
Effect> CssMetaData<S,E> createEffectCssMetaData(String property, Function<S,StyleableProperty > function, E initialValue, boolean inherits) Create a CssMetaDatawith initial value, and inherit flag.- Type Parameters:
E
- The CssMetaData created with initial value and inherit flag- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEffectCssMetaData
public final
Effect> CssMetaData<S,E> createEffectCssMetaData(String property, Function<S,StyleableProperty > function, E initialValue) Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Type Parameters:
E
- The CssMetaData created with initial value and false inherit flag- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEffectCssMetaData
public final
Effect> CssMetaData<S,E> createEffectCssMetaData(String property, Function<S,StyleableProperty > function) Create a CssMetaDatawith initial value of null, and inherit flag defaulting to false.- Type Parameters:
E
- The CssMetaData created with null initial value and false inherit flag- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with null initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEnumCssMetaData
public final
Enum > CssMetaData<S,E> createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty > function, E initialValue, boolean inherits) Create a CssMetaDatawith initial value, and inherit flag.- Type Parameters:
E
- The CssMetaData created with initial value and inherit flag- Parameters:
enumClass
- The Enum class that is the type of the CssMetaData>. property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEnumCssMetaData
public final
Enum > CssMetaData<S,E> createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty > function, E initialValue) Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Type Parameters:
E
- The CssMetaData created with initial value and false inherit flag- Parameters:
enumClass
- The Enum class that is the type of the CssMetaData>. property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createEnumCssMetaData
public final
Enum > CssMetaData<S,E> createEnumCssMetaData(Class extends Enum> enumClass, String property, Function<S,StyleableProperty > function) Create a CssMetaDatawith initial value of null, and inherit flag defaulting to false.- Type Parameters:
E
- The CssMetaData created with null initial value and false inherit flag- Parameters:
enumClass
- The Enum class that is the type of the CssMetaData>. property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with null initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createFontCssMetaData
public final CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function, Font initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleableProperty that corresponds to this CssMetaData.initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createFontCssMetaData
public final CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function, Font initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to true.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleableProperty that corresponds to this CssMetaData.initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and true inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createFontCssMetaData
public final CssMetaData<S,Font> createFontCssMetaData(String property, Function<S,StyleableProperty<Font>> function)
Create a CssMetaDatawith initial value ofFont.getDefault()
, and inherit flag defaulting to true.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleableProperty that corresponds to this CssMetaData.- Returns:
- a CssMetaData created with initial value, and true inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createInsetsCssMetaData
public final CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function, Insets initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createInsetsCssMetaData
public final CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function, Insets initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createInsetsCssMetaData
public final CssMetaData<S,Insets> createInsetsCssMetaData(String property, Function<S,StyleableProperty<Insets>> function)
Create a CssMetaDatawith initial value ofInsets.EMPTY
, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createPaintCssMetaData
public final CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function, Paint initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createPaintCssMetaData
public final CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function, Paint initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createPaintCssMetaData
public final CssMetaData<S,Paint> createPaintCssMetaData(String property, Function<S,StyleableProperty<Paint>> function)
Create a CssMetaDatawith initial value of Color.BLACK, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createSizeCssMetaData
public final CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function, Number initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createSizeCssMetaData
public final CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function, Number initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createSizeCssMetaData
public final CssMetaData<S,Number> createSizeCssMetaData(String property, Function<S,StyleableProperty<Number>> function)
Create a CssMetaDatawith initial value of0d
, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createStringCssMetaData
public final CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createStringCssMetaData
public final CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue)
Create a CssMetaDatawith initial value, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createStringCssMetaData
public final CssMetaData<S,String> createStringCssMetaData(String property, Function<S,StyleableProperty<String>> function)
Create a CssMetaDatawith initial value of null, and inherit flag defaulting to false.- Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with null initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createUrlCssMetaData
public final CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue, boolean inherits)
Create a CssMetaDatawith initial value, and inherit flag. Here, the String value represents a URL converted from a CSS url(""). - Parameters:
property
- The CSS property name.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.inherits
- Whether or not the CSS style can be inherited by child nodes- Returns:
- a CssMetaData created with initial value, and inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createUrlCssMetaData
public final CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function, String initialValue)
Create a CssMetaDatawith 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.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. initialValue
- The initial value of the property. CSS may reset the property to this value.- Returns:
- a CssMetaData created with initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
createUrlCssMetaData
public final CssMetaData<S,String> createUrlCssMetaData(String property, Function<S,StyleableProperty<String>> function)
Create a CssMetaDatawith 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.function
- A function that returns the StyleablePropertythat corresponds to this CssMetaData. - Returns:
- a CssMetaData created with null initial value, and false inherit flag
- Throws:
IllegalArgumentException
- ifproperty
is null or an empty string, orfunction
is null.
-
-