Package javafx.css

Interface StyleableProperty<T>

All Superinterfaces:
WritableValue<T>
All Known Implementing Classes:
StyleableBooleanProperty, StyleableIntegerProperty, StyleableObjectProperty

public interface StyleableProperty<T> extends WritableValue<T>
StyleableProperty allows a javafx.beans.property to be styled from CSS.

This interface allows coordination between CSS processing and a javafx.beans.property. The implementation ensure that the priority for setting the value is, in increasing order and assuming equal importance:

  1. a style from a user agent stylesheet in
    invalid @link
    javafx.application.Application#setUserAgentStylesheet(java.lang.String)
  2. value set from code, for example calling
    invalid @link
    javafx.scene.Node#setOpacity(double)
  3. a style from an author stylesheet in Scene.getStylesheets() or
    invalid @link
    javafx.scene.Parent#getStylesheets()
  4. a style from Node.setStyle(java.lang.String)

The StyleablePropertyFactory greatly simplifies creating a StyleableProperty and its corresponding CssMetaData.

Since:
JavaFX 8.0
See Also:
  • StyleablePropertyFactory
  • Method Details

    • applyStyle

      void applyStyle(StyleOrigin origin, T value)
      This method is called from CSS code to set the value of the property.
    • getStyleOrigin

      StyleOrigin getStyleOrigin()
      Tells the origin of the value of the property. This is needed to determine whether or not CSS can override the value.
    • getCssMetaData

      CssMetaData<? extends Styleable,T> getCssMetaData()
      Reflect back the CssMetaData that corresponds to this javafx.beans.property.StyleableProperty