RFR: 8375588: Enhanced property metadata
Michael Strauß
mstrauss at openjdk.org
Mon Jan 19 03:47:04 UTC 2026
On Sun, 21 Dec 2025 13:40:14 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
> I think the `getDeclaringClass` on `ReadOnlyProperty` is okayish; however, I'd probably never take the time to override this method with a proper value, mostly because this requires creating a subclass to be efficient. I know that within JavaFX, creating a subclass for each and every property (resulting in 1000's of subclasses) is "the standard", but for my own use, I never do this as it is just too much boilerplate.
You can also specify it in the constructor of the `Simple*`-properties, along with the bean and name.
> I do however have a bit of problem with `isAttached`; what does this have to do with properties in general? The description doesn't clarify what it means really, or what it even means outside the very specific case where HBox can "donate" properties to its children.
>
> So to me, the attached part feels out of place for a low-level property API, unless there are compelling reasons and other use cases we'd envision outside of having CSS stylable child properties. If not, I don't see why we shouldn't make this a method on `Stylable` or something more Node/CSS specific like in this PR: #1714
I think attached-ness is a fundamental aspect of properties, and making it visible in the type system is a logical choice. Compare this to WPF or Avalonia, where attached properties are also explicitly modelled. It's a piece of information that you can't reliably get from a property's metadata otherwise.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/2015#issuecomment-3679602635
More information about the openjfx-dev
mailing list