When using an ObjectProperty<Color> in combination with a StyleableProperty I have the problem that an attached Listener won't be triggered and I get a Warning on the console like:
Nov 27, 2013 4:01:16 PM javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve 'a lookup value' while resolving lookups for '-area-color' from rule '*.my-control' in stylesheet file:/Users/hansolo/IntelliJ_Projects/FX8Playground/out/production/FX8Playground/issues/custom.css
Nov 27, 2013 4:01:16 PM javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve 'a lookup value' while resolving lookups for '-area-color' from rule '*.my-control' in stylesheet file:/Users/hansolo/IntelliJ_Projects/FX8Playground/out/production/FX8Playground/issues/custom.css
The problem seems to be related to the ColorConverter because when I exchange the ColorConverter with a PaintConverter everything seems to be ok.
Please find a little example control here: https://dl.dropboxusercontent.com/u/84552/issues/rt-34541.zip
In the example I created a custom control that simply uses two StyleableProperties (one as Paint and the other as Color) and then simply load another CSS file that overrides the related styles in CSS. Only the InvalidationListener that is hooked up to the ObjectProperty<Paint> is triggered but not the one that is hooked up to the ObjectProperty<Color>.
Nov 27, 2013 4:01:16 PM javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve 'a lookup value' while resolving lookups for '-area-color' from rule '*.my-control' in stylesheet file:/Users/hansolo/IntelliJ_Projects/FX8Playground/out/production/FX8Playground/issues/custom.css
Nov 27, 2013 4:01:16 PM javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve 'a lookup value' while resolving lookups for '-area-color' from rule '*.my-control' in stylesheet file:/Users/hansolo/IntelliJ_Projects/FX8Playground/out/production/FX8Playground/issues/custom.css
The problem seems to be related to the ColorConverter because when I exchange the ColorConverter with a PaintConverter everything seems to be ok.
Please find a little example control here: https://dl.dropboxusercontent.com/u/84552/issues/rt-34541.zip
In the example I created a custom control that simply uses two StyleableProperties (one as Paint and the other as Color) and then simply load another CSS file that overrides the related styles in CSS. Only the InvalidationListener that is hooked up to the ObjectProperty<Paint> is triggered but not the one that is hooked up to the ObjectProperty<Color>.
- duplicates
-
JDK-8092514 The style converter obtained by StyleConverter.getColorConverter() does not work.
- Closed
- relates to
-
JDK-8087791 ColorConverter should not cover up exception by returning BLACK if value is not a valid color
- Open