SimpleStyleable<Foo>Properties API Questions

David Grieve david.grieve at
Wed Mar 13 19:38:52 PDT 2013

On Mar 13, 2013, at 9:23 PM, Danno Ferrin <danno.ferrin at> wrote:

> So I am getting around to porting my style code for my deck control to
> JDK8, and I ran across the SimpleStyleable<Foo>Property family of objects,
> and I have a couple of questions/crutiques
> 1. Why is it marked abstract?  The docs claim
> that StyleableProperty#getCssMetaData() is not implemented and you have to
> do it, and yet not only is it implemented it is final, and you cannot
> override it!  There are no abstract methods, so the abstract modifier could
> easily be removed.

Doh!  Just an oversight. I'm glad you found it! I'll file a bug for it.

> 2.  Why does it extend from Simple<Foo>Property instead of
> Styleable<Foo>Property?  Just an implementation convenience?  I think it
> would be more valuable to extend from the Styleable property than the
> Simple property, since simple only adds implementation but styleable adds
> implementation for a new interface.  I see myself adding more
> StyleableDoubleProperties that are backed by a Simple varient than a
> SimpleDoubleProperty backed by the styleable variant.

Because we want SimpleStyleable<Foo>Property to be a Simple<Foo>Property _and_ a StyleableProperty. It is the only way to do it since Simple<Foo>Property is a class and StyleableProperty is an interface. To do it the other way around would require that the SimpleStyleable<Foo>Property re-implement the entire Simple<Foo>Property API - <Foo>PropertyBase, <Foo>Property, ReadOnly<Foo>Property and so on. 

I can understand that you want to be able to do 'StyleableDoubleProperty foo = new SimpleStyleableDoubleProperty(FOO);'  But you can do 'StyleableProperty<Double> foo = new SimpleStyleableDoubleProperty(FOO);'

> Is it too late in the game to make these API changes?
> -- 
> Danno Ferrin

More information about the openjfx-dev mailing list